Hullo, it seems reviewboard cannot connect to anonsvn (at least from here) so i'm attaching the patch here as it is really small.
Having a look at https://bugs.kde.org/show_bug.cgi?id=231791 you can see how easy is reproducing the bug. It seems that kickoff does not allow adding favorites via D&D. D&D is only used to move items in the list. This little patch allows adding favorites via D&D dragging from the application view to the favorites one. I just don't know if this is considered as a new feature. It seems to me that this patch just makes kickoff behaving as it is expected to behave. Anyway the last word is yours of course, plasma-friends :) Regards. -- Alessandro Diaferia KDE Developer KDE e.V. member
Index: core/favoritesmodel.cpp =================================================================== --- core/favoritesmodel.cpp (revisione 1129455) +++ core/favoritesmodel.cpp (copia locale) @@ -29,6 +29,7 @@ // KDE #include <KConfigGroup> #include <KService> +#include <KDesktopFile> #include <kdebug.h> using namespace Kickoff; @@ -265,9 +266,9 @@ bool FavoritesModel::dropMimeData(const if (action == Qt::MoveAction) { QModelIndex modelIndex; QStandardItem *startItem; - int startRow = 0, destRow; + int startRow = -1; - destRow = row; + int destRow = row; // look for the favorite that was dragged for (int i = 0; i < d->headerItem->rowCount(); i++) { @@ -279,6 +280,23 @@ bool FavoritesModel::dropMimeData(const } } + if (startRow < 0) { + if (!data->urls().isEmpty() && data->urls().first().isValid()) { + const QString path = data->urls().first().toLocalFile(); + if (!KDesktopFile::isDesktopFile(path)) { + return false; + } + KDesktopFile dFile(path); + if (dFile.hasApplicationType() && !dFile.noDisplay()) { + FavoritesModel::add(path); + return true; + } + + return false; + } + return false; + } + if (destRow < 0) return false; Index: ui/urlitemview.cpp =================================================================== --- ui/urlitemview.cpp (revisione 1129455) +++ ui/urlitemview.cpp (copia locale) @@ -23,6 +23,7 @@ // Qt #include <QtCore/QHash> #include <QtCore/QPersistentModelIndex> +#include <QtCore/QUrl> #include <QtGui/QMouseEvent> #include <QtGui/QPainter> @@ -30,6 +31,7 @@ #include <QtGui/QScrollBar> #include <QtGui/QToolTip> + // KDE #include <KDebug> #include <KGlobalSettings> @@ -675,6 +677,10 @@ void UrlItemView::dropEvent(QDropEvent * int row; QPoint pos = event->pos(); QModelIndex parent = indexAt(pos); + + if (!parent.isValid()) { + return; + } const QRect rect = visualRect(parent); row = parent.row();
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel