#include <QPixmap>
#include <kglobalsettings.h>
#include <qclipboard.h>
-#include <kurldrag.h>
#include <klocale.h>
#include "dolphin.h"
delete m_pixmapCopy;
m_pixmapCopy = 0;
- m_highlightedURL = 0;
+ m_highlightedUrl = 0;
}
void ItemEffectsManager::zoomIn()
void ItemEffectsManager::activateItem(void* context)
{
KFileItem* fileInfo = contextFileInfo(context);
- const KUrl itemURL(fileInfo->url());
- if (m_highlightedURL == itemURL) {
+ const KUrl itemUrl(fileInfo->url());
+ if (m_highlightedUrl == itemUrl) {
// the item is already highlighted
return;
}
// remember the pixmap and item to be able to
// restore it to the old state later
*m_pixmapCopy = *itemPixmap;
- m_highlightedURL = itemURL;
+ m_highlightedUrl = itemUrl;
// apply an icon effect to the item below the mouse pointer
KIconEffect iconEffect;
QPixmap pixmap = iconEffect.apply(*itemPixmap,
- KIcon::Desktop,
- KIcon::ActiveState);
+ K3Icon::Desktop,
+ K3Icon::ActiveState);
setContextPixmap(context, pixmap);
}
void ItemEffectsManager::resetActivatedItem()
{
- if (m_highlightedURL.isEmpty()) {
+ if (m_highlightedUrl.isEmpty()) {
return;
}
for (void* context = firstContext(); context != 0; context = nextContext(context)) {
- KUrl itemURL(contextFileInfo(context)->url());
- if (itemURL == m_highlightedURL) {
+ KUrl itemUrl(contextFileInfo(context)->url());
+ if (itemUrl == m_highlightedUrl) {
// the highlighted item has been found and is restored to the default state
KIconEffect iconEffect;
QPixmap pixmap = iconEffect.apply(*m_pixmapCopy,
- KIcon::Desktop,
- KIcon::DefaultState);
+ K3Icon::Desktop,
+ K3Icon::DefaultState);
// TODO: KFileIconView does not emit any signal when the preview has been finished.
// Hence check the size to prevent that a preview is hidden by restoring a
}
}
- m_highlightedURL = 0;
+ m_highlightedUrl = 0;
DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar();
statusBar->clear();
// restore all disabled items with their original pixmap
for (void* context = firstContext(); context != 0; context = nextContext(context)) {
const KFileItem* fileInfo = contextFileInfo(context);
- const KUrl& fileURL = fileInfo->url();
+ const KUrl& fileUrl = fileInfo->url();
Q3ValueListIterator<DisabledItem> it = m_disabledItems.begin();
while (it != m_disabledItems.end()) {
- if (fileURL == (*it).url) {
+ if (fileUrl == (*it).url) {
setContextPixmap(context, (*it).pixmap);
}
++it;
}
QClipboard* clipboard = QApplication::clipboard();
- QMimeSource* data = clipboard->data();
- if (!KUrlDrag::canDecode(data)) {
+ const QMimeData* data = clipboard->mimeData();
+ KUrl::List urls = KUrl::List::fromMimeData(data);
+ if (urls.isEmpty()) {
return;
}
// The clipboard contains items, which have been cutted. Change the pixmaps of all those
// items to the disabled state.
- KUrl::List urls;
- KUrlDrag::decode(data, urls);
for (void* context = firstContext(); context != 0; context = nextContext(context)) {
const KFileItem* fileInfo = contextFileInfo(context);
- const KUrl& fileURL = fileInfo->url();
+ const KUrl& fileUrl = fileInfo->url();
for(KUrl::List::ConstIterator it = urls.begin(); it != urls.end(); ++it) {
- if (fileURL == (*it)) {
+ if (fileUrl == (*it)) {
const QPixmap* itemPixmap = contextPixmap(context);
if (itemPixmap != 0) {
// remember old pixmap
DisabledItem disabledItem;
- disabledItem.url = fileURL;
+ disabledItem.url = fileUrl;
disabledItem.pixmap = *itemPixmap;
m_disabledItems.append(disabledItem);
KIconEffect iconEffect;
QPixmap disabledPixmap = iconEffect.apply(*itemPixmap,
- KIcon::Desktop,
- KIcon::DisabledState);
+ K3Icon::Desktop,
+ K3Icon::DisabledState);
setContextPixmap(context, disabledPixmap);
}
break;
// KFileItem::getStatusBar() returns "MyDocuments/ Folder" as
// status bar text for a folder 'MyDocuments'. This is adjusted
// to "MyDocuments (Folder)" in Dolphin.
- return i18n("%1 (Folder)").arg(fileInfo->name());
+ return i18n("%1 (Folder)",fileInfo->name());
}
return fileInfo->getStatusBarInfo();