From 116fa8936a78906d70c8ce9078d2ea54318a4e2b Mon Sep 17 00:00:00 2001 From: Nick Tiskov Date: Tue, 4 Jun 2013 18:47:01 +0400 Subject: [PATCH] Add missing QTreeWidget::dropEvent to d'n'd atempt occuring in same location. Remove 'Overwrite attempt' dialog as obsolete. Now moving item, e.g. from folder to same folder, will just make it the last child of the folder. --- src/rss/feedlistwidget.cpp | 2 +- src/rss/feedlistwidget.h | 1 - src/rss/rss_imp.cpp | 8 -------- src/rss/rss_imp.h | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/rss/feedlistwidget.cpp b/src/rss/feedlistwidget.cpp index 17f7e86a5..58abdc156 100644 --- a/src/rss/feedlistwidget.cpp +++ b/src/rss/feedlistwidget.cpp @@ -205,7 +205,7 @@ void FeedListWidget::dropEvent(QDropEvent *event) { foreach (QTreeWidgetItem *src_item, src_items) { RssFilePtr file = getRSSItem(src_item); if (dest_folder->hasChild(file->id())) { - emit overwriteAttempt(file->id()); + QTreeWidget::dropEvent(event); return; } } diff --git a/src/rss/feedlistwidget.h b/src/rss/feedlistwidget.h index 03e4bd4fb..89f99eb98 100644 --- a/src/rss/feedlistwidget.h +++ b/src/rss/feedlistwidget.h @@ -71,7 +71,6 @@ public slots: signals: void foldersAltered(const QList &folders); - void overwriteAttempt(const QString &filename); private slots: void updateCurrentFeed(QTreeWidgetItem* new_item); diff --git a/src/rss/rss_imp.cpp b/src/rss/rss_imp.cpp index 0a431f14d..dcd6fb1cd 100644 --- a/src/rss/rss_imp.cpp +++ b/src/rss/rss_imp.cpp @@ -168,13 +168,6 @@ void RSSImp::askNewFolder() m_rssManager->saveStreamList(); } -void RSSImp::displayOverwriteError(const QString& filename) -{ - QMessageBox::warning(this, tr("Overwrite attempt"), - tr("You cannot overwrite %1 item.", "You cannot overwrite myFolder item.").arg(filename), - QMessageBox::Ok); -} - // add a stream by a button void RSSImp::on_newFeedButton_clicked() { @@ -717,7 +710,6 @@ RSSImp::RSSImp(QWidget *parent) : connect(m_feedList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(populateArticleList(QTreeWidgetItem*))); connect(m_feedList, SIGNAL(foldersAltered(QList)), this, SLOT(updateItemsInfos(QList))); - connect(m_feedList, SIGNAL(overwriteAttempt(QString)), this, SLOT(displayOverwriteError(QString))); connect(listArticles, SIGNAL(itemSelectionChanged()), this, SLOT(refreshTextBrowser())); connect(listArticles, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(downloadSelectedTorrents())); diff --git a/src/rss/rss_imp.h b/src/rss/rss_imp.h index b88c73695..ec8b747c4 100644 --- a/src/rss/rss_imp.h +++ b/src/rss/rss_imp.h @@ -79,7 +79,6 @@ private slots: void askNewFolder(); void saveFoldersOpenState(); void loadFoldersOpenState(); - void displayOverwriteError(const QString &filename); void on_actionManage_cookies_triggered(); void on_settingsButton_clicked(); void on_rssDownloaderBtn_clicked();