X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/fa9bd6bed5e35007c476a950ffe554f796b8846e..e9a39700:/src/panels/places/placesitemmodel.cpp diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index a1223b5fd..8ac6b46a8 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -1,25 +1,12 @@ -/*************************************************************************** - * Copyright (C) 2012 by Peter Penz * - * * - * Based on KFilePlacesModel from kdelibs: * - * Copyright (C) 2007 Kevin Ottens * - * Copyright (C) 2007 David Faure * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2012 Peter Penz + * + * Based on KFilePlacesModel from kdelibs: + * SPDX-FileCopyrightText: 2007 Kevin Ottens + * SPDX-FileCopyrightText: 2007 David Faure + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "placesitemmodel.h" @@ -250,7 +237,7 @@ void PlacesItemModel::requestEject(int index) } else { const QString label = item->text(); const QString message = i18nc("@info", "The device '%1' is not a disk and cannot be ejected.", label); - emit errorMessage(message); + Q_EMIT errorMessage(message); } } } @@ -267,7 +254,7 @@ void PlacesItemModel::requestTearDown(int index) // after we have emitted PlacesItemModel::storageTearDownRequested disconnect(tmp, &Solid::StorageAccess::teardownRequested, item->signalHandler(), &PlacesItemSignalHandler::onTearDownRequested); - emit storageTearDownRequested(tmp->filePath()); + Q_EMIT storageTearDownRequested(tmp->filePath()); } } } @@ -480,12 +467,15 @@ void PlacesItemModel::slotStorageTearDownDone(Solid::ErrorType error, const QVar "One or more files on this device are opened in following applications: %2.", blockingApps.count(), blockingApps.join(i18nc("separator in list of apps blocking device unmount", ", "))); } - emit errorMessage(errorString); + Q_EMIT errorMessage(errorString); }); listOpenFilesJob->start(); } else { - emit errorMessage(errorData.toString()); + Q_EMIT errorMessage(errorData.toString()); } + } else { + // No error; it must have been unmounted successfully + emit storageTearDownSuccessful(); } disconnect(m_deviceToTearDown, &Solid::StorageAccess::teardownDone, this, &PlacesItemModel::slotStorageTearDownDone); @@ -506,16 +496,16 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error, if (error != Solid::NoError) { if (errorData.isValid()) { - emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2", + Q_EMIT errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2", item->text(), errorData.toString())); } else { - emit errorMessage(i18nc("@info", "An error occurred while accessing '%1'", + Q_EMIT errorMessage(i18nc("@info", "An error occurred while accessing '%1'", item->text())); } - emit storageSetupDone(index, false); + Q_EMIT storageSetupDone(index, false); } else { - emit storageSetupDone(index, true); + Q_EMIT storageSetupDone(index, true); } }