diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 12 | ||||
| -rw-r--r-- | src/dolphinmainwindow.h | 3 | ||||
| -rw-r--r-- | src/draganddrophelper.cpp | 16 | ||||
| -rw-r--r-- | src/draganddrophelper.h | 2 |
4 files changed, 13 insertions, 20 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 3f0b215cc..d93ff83e4 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -115,8 +115,8 @@ DolphinMainWindow::DolphinMainWindow(int id) : this, SLOT(showCommand(CommandType))); connect(DolphinSettings::instance().placesModel(), SIGNAL(errorMessage(const QString&)), this, SLOT(showErrorMessage(const QString&))); - connect(&DragAndDropHelper::instance(), SIGNAL(informationMessage(const QString&)), - this, SLOT(showInformationMessage(const QString&))); + connect(&DragAndDropHelper::instance(), SIGNAL(errorMessage(const QString&)), + this, SLOT(showErrorMessage(const QString&))); } DolphinMainWindow::~DolphinMainWindow() @@ -450,14 +450,6 @@ void DolphinMainWindow::showErrorMessage(const QString& message) } } -void DolphinMainWindow::showInformationMessage(const QString& message) -{ - if (!message.isEmpty()) { - DolphinStatusBar* statusBar = m_activeViewContainer->statusBar(); - statusBar->setMessage(message, DolphinStatusBar::Information); - } -} - void DolphinMainWindow::slotUndoAvailable(bool available) { QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo)); diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 8cfdda34a..464083696 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -171,9 +171,6 @@ private slots: /** Shows the error message in the status bar of the active view. */ void showErrorMessage(const QString& message); - /** Shows the information message in the status bar of the active view. */ - void showInformationMessage(const QString& message); - /** * Updates the state of the 'Undo' menu action dependent * from the parameter \a available. diff --git a/src/draganddrophelper.cpp b/src/draganddrophelper.cpp index d8c55ed12..bdbcfae19 100644 --- a/src/draganddrophelper.cpp +++ b/src/draganddrophelper.cpp @@ -101,13 +101,17 @@ void DragAndDropHelper::dropUrls(const KFileItem& destItem, QDBusConnection::sessionBus().call(message); } else { const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData()); - const KUrl sourceDir = KUrl(urls.first().directory()); - if (sourceDir == destination) { + const KUrl source = urls.first(); + const KUrl sourceDir = KUrl(source.directory()); + + if ((urls.count() == 1) && (source == destination)) { + emit errorMessage(i18nc("@info:status", "A folder cannot dropped on to itself")); + } else if (sourceDir == destination) { const QString msg = i18ncp("@info:status", - "The dropped item is already inside the folder %2", - "The dropped items are already inside the folder %2", - urls.count(), destination.fileName()); - emit informationMessage(msg); + "The dropped item <filename>%2</filename> is already inside the folder <filename>%3</filename>", + "The dropped items are already inside the folder <filename>%3</filename>", + urls.count(), source.fileName(), destination.fileName()); + emit errorMessage(msg); } else if (dropToItem) { KonqOperations::doDrop(destItem, destination, event, widget); } else { diff --git a/src/draganddrophelper.h b/src/draganddrophelper.h index 907dd0c2c..e62897208 100644 --- a/src/draganddrophelper.h +++ b/src/draganddrophelper.h @@ -76,7 +76,7 @@ public: QDropEvent* event, QWidget* widget); signals: - void informationMessage(const QString& msg); + void errorMessage(const QString& msg); private: DragAndDropHelper(); |
