mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
plasma: implement drag for favorites in launcher applet
piece of cake with the custom widget class Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6bdd5f3d39
commit
07e7d318a7
1 changed files with 7 additions and 5 deletions
|
@ -770,13 +770,13 @@ void LauncherFavorites::slotUpdateLayout()
|
|||
bookmark = bookmarkgroup.next(bookmark);
|
||||
continue;
|
||||
}
|
||||
const QString serviceentrypath = bookmark.url().url();
|
||||
KService::Ptr service = KService::serviceByDesktopPath(serviceentrypath);
|
||||
const QString bookmarkentrypath = bookmark.url().url();
|
||||
KService::Ptr service = KService::serviceByDesktopPath(bookmarkentrypath);
|
||||
if (service.isNull()) {
|
||||
service = KService::serviceByDesktopName(bookmark.text());
|
||||
}
|
||||
if (service.isNull()) {
|
||||
kWarning() << "could not find service for" << serviceentrypath;
|
||||
kWarning() << "could not find service for" << bookmarkentrypath;
|
||||
bookmark = bookmarkgroup.next(bookmark);
|
||||
continue;
|
||||
}
|
||||
|
@ -784,17 +784,19 @@ void LauncherFavorites::slotUpdateLayout()
|
|||
launcherwidget->setup(
|
||||
iconsize, kFavoriteIcon(service->icon()), service->name(), service->genericName()
|
||||
);
|
||||
launcherwidget->setData(service->entryPath());
|
||||
const QString entrypath = service->entryPath();
|
||||
launcherwidget->setData(entrypath);
|
||||
QAction* favoriteaction = new QAction(launcherwidget);
|
||||
favoriteaction->setIcon(KIcon("edit-delete"));
|
||||
favoriteaction->setToolTip(i18n("Remove"));
|
||||
favoriteaction->setProperty("_k_id", serviceentrypath);
|
||||
favoriteaction->setProperty("_k_id", bookmarkentrypath);
|
||||
connect(
|
||||
favoriteaction, SIGNAL(triggered()),
|
||||
this, SLOT(slotTriggered()),
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
launcherwidget->addAction(favoriteaction);
|
||||
launcherwidget->setMimeData(kMakeMimeData(entrypath));
|
||||
m_launcherwidgets.append(launcherwidget);
|
||||
m_layout->addItem(launcherwidget);
|
||||
connect(
|
||||
|
|
Loading…
Add table
Reference in a new issue