Changeset View
Changeset View
Standalone View
Standalone View
krusader/FileSystem/krtrashhandler.cpp
Show All 29 Lines | |||||
30 | #include <KIO/Job> | 30 | #include <KIO/Job> | ||
31 | #include <KIO/JobUiDelegate> | 31 | #include <KIO/JobUiDelegate> | ||
32 | #include <KIO/RestoreJob> | 32 | #include <KIO/RestoreJob> | ||
33 | #include <KJobWidgets/KJobWidgets> | 33 | #include <KJobWidgets/KJobWidgets> | ||
34 | 34 | | |||
35 | #include "filesystemprovider.h" | 35 | #include "filesystemprovider.h" | ||
36 | #include "../kractions.h" | 36 | #include "../kractions.h" | ||
37 | #include "../krglobal.h" | 37 | #include "../krglobal.h" | ||
38 | #include "../icon.h" | ||||
38 | 39 | | |||
39 | 40 | | |||
40 | KrTrashWatcher * KrTrashHandler::_trashWatcher = 0; | 41 | KrTrashWatcher * KrTrashHandler::_trashWatcher = 0; | ||
41 | 42 | | |||
42 | bool KrTrashHandler::isTrashEmpty() | 43 | bool KrTrashHandler::isTrashEmpty() | ||
43 | { | 44 | { | ||
44 | KConfig trashConfig("trashrc"); | 45 | KConfig trashConfig("trashrc"); | ||
45 | KConfigGroup cfg(&trashConfig, "Status"); | 46 | KConfigGroup cfg(&trashConfig, "Status"); | ||
46 | return cfg.readEntry("Empty", false); | 47 | return cfg.readEntry("Empty", false); | ||
47 | } | 48 | } | ||
48 | 49 | | |||
49 | QString KrTrashHandler::trashIcon() | 50 | QString KrTrashHandler::trashIconName() | ||
50 | { | 51 | { | ||
51 | return isTrashEmpty() ? "user-trash" : "user-trash-full"; | 52 | return isTrashEmpty() ? "user-trash" : "user-trash-full"; | ||
52 | } | 53 | } | ||
53 | 54 | | |||
54 | void KrTrashHandler::emptyTrash() | 55 | void KrTrashHandler::emptyTrash() | ||
55 | { | 56 | { | ||
56 | KIO::JobUiDelegate uiDelegate; | 57 | KIO::JobUiDelegate uiDelegate; | ||
57 | uiDelegate.setWindow(krMainWindow); | 58 | uiDelegate.setWindow(krMainWindow); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
107 | KrTrashWatcher::~KrTrashWatcher() | 108 | KrTrashWatcher::~KrTrashWatcher() | ||
108 | { | 109 | { | ||
109 | delete _watcher; | 110 | delete _watcher; | ||
110 | _watcher = 0; | 111 | _watcher = 0; | ||
111 | } | 112 | } | ||
112 | 113 | | |||
113 | void KrTrashWatcher::slotTrashChanged() | 114 | void KrTrashWatcher::slotTrashChanged() | ||
114 | { | 115 | { | ||
115 | KrActions::actTrashBin->setIcon(QIcon::fromTheme(KrTrashHandler::trashIcon())); | 116 | KrActions::actTrashBin->setIcon(Icon(KrTrashHandler::trashIconName())); | ||
116 | } | 117 | } |