-/***************************************************************************
- * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> *
- * *
- * Based on KFilePlacesModel from kdelibs: *
- * Copyright (C) 2007 Kevin Ottens <ervin@kde.org> *
- * Copyright (C) 2007 David Faure <faure@kde.org> *
- * *
- * 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 <peter.penz19@gmail.com>
+ *
+ * Based on KFilePlacesModel from kdelibs:
+ * SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
+ * SPDX-FileCopyrightText: 2007 David Faure <faure@kde.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#include "placesitemmodel.h"
} 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);
}
}
}
// after we have emitted PlacesItemModel::storageTearDownRequested
disconnect(tmp, &Solid::StorageAccess::teardownRequested,
item->signalHandler(), &PlacesItemSignalHandler::onTearDownRequested);
- emit storageTearDownRequested(tmp->filePath());
+ Q_EMIT storageTearDownRequested(tmp->filePath());
}
}
}
"One or more files on this device are opened in following applications: <application>%2</application>.",
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);
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);
}
}