]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/information/informationpanel.cpp
allow to hide the rating, comments and tags of the Information Panel
[dolphin.git] / src / panels / information / informationpanel.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 #include "informationpanel.h"
21
22 #include <config-nepomuk.h>
23
24 #include <kdialog.h>
25 #include <kdirnotify.h>
26 #include <kfileitem.h>
27 #include <kfilemetainfo.h>
28 #include <kfileplacesmodel.h>
29 #include <kglobalsettings.h>
30 #include <kio/previewjob.h>
31 #include <kiconeffect.h>
32 #include <kiconloader.h>
33 #include <klocale.h>
34 #include <kmenu.h>
35 #include <kseparator.h>
36
37 #ifdef HAVE_NEPOMUK
38 #include <Nepomuk/Resource>
39 #include <Nepomuk/Types/Property>
40 #include <Nepomuk/Variant>
41 #endif
42
43 #include <Phonon/BackendCapabilities>
44 #include <Phonon/MediaObject>
45 #include <Phonon/SeekSlider>
46
47 #include <QEvent>
48 #include <QInputDialog>
49 #include <QLabel>
50 #include <QPainter>
51 #include <QPixmap>
52 #include <QResizeEvent>
53 #include <QScrollArea>
54 #include <QTextLayout>
55 #include <QTextLine>
56 #include <QTimer>
57 #include <QScrollBar>
58 #include <QVBoxLayout>
59
60 #include "dolphin_informationpanelsettings.h"
61 #include "settings/dolphinsettings.h"
62 #include "metadatawidget.h"
63 #include "metatextlabel.h"
64 #include "phononwidget.h"
65 #include "pixmapviewer.h"
66
67 /**
68 * Helper function for sorting items with qSort() in
69 * InformationPanel::contextMenu().
70 */
71 bool lessThan(const QAction* action1, const QAction* action2)
72 {
73 return action1->text() < action2->text();
74 }
75
76
77 InformationPanel::InformationPanel(QWidget* parent) :
78 Panel(parent),
79 m_initialized(false),
80 m_pendingPreview(false),
81 m_infoTimer(0),
82 m_outdatedPreviewTimer(0),
83 m_shownUrl(),
84 m_urlCandidate(),
85 m_fileItem(),
86 m_selection(),
87 m_nameLabel(0),
88 m_preview(0),
89 m_phononWidget(0),
90 m_metaDataWidget(0),
91 m_metaTextArea(0),
92 m_metaTextLabel(0)
93 {
94 }
95
96 InformationPanel::~InformationPanel()
97 {
98 }
99
100 QSize InformationPanel::sizeHint() const
101 {
102 QSize size = Panel::sizeHint();
103 size.setWidth(minimumSizeHint().width());
104 return size;
105 }
106
107 void InformationPanel::setUrl(const KUrl& url)
108 {
109 Panel::setUrl(url);
110 if (url.isValid() && !isEqualToShownUrl(url)) {
111 if (isVisible()) {
112 cancelRequest();
113 m_shownUrl = url;
114 showItemInfo();
115 } else {
116 m_shownUrl = url;
117 }
118 }
119 }
120
121 void InformationPanel::setSelection(const KFileItemList& selection)
122 {
123 if (!isVisible()) {
124 return;
125 }
126
127 if ((selection.count() == 0) && (m_selection.count() == 0)) {
128 // The selection has not really changed, only the current index.
129 // QItemSelectionModel emits a signal in this case and it is less
130 // expensive doing the check this way instead of patching
131 // DolphinView::emitSelectionChanged().
132 return;
133 }
134
135 m_selection = selection;
136
137 const int count = selection.count();
138 if (count == 0) {
139 if (!isEqualToShownUrl(url())) {
140 m_shownUrl = url();
141 showItemInfo();
142 }
143 } else {
144 if ((count == 1) && !selection.first().url().isEmpty()) {
145 m_urlCandidate = selection.first().url();
146 }
147 m_infoTimer->start();
148 }
149 }
150
151 void InformationPanel::requestDelayedItemInfo(const KFileItem& item)
152 {
153 if (!isVisible()) {
154 return;
155 }
156
157 cancelRequest();
158
159 m_fileItem = KFileItem();
160 if (item.isNull()) {
161 // The cursor is above the viewport. If files are selected,
162 // show information regarding the selection.
163 if (m_selection.size() > 0) {
164 m_pendingPreview = false;
165 m_infoTimer->start();
166 }
167 } else {
168 const KUrl url = item.url();
169 if (url.isValid() && !isEqualToShownUrl(url)) {
170 m_urlCandidate = item.url();
171 m_fileItem = item;
172 m_infoTimer->start();
173 }
174 }
175 }
176
177 void InformationPanel::showEvent(QShowEvent* event)
178 {
179 Panel::showEvent(event);
180 if (!event->spontaneous()) {
181 if (!m_initialized) {
182 // do a delayed initialization so that no performance
183 // penalty is given when Dolphin is started with a closed
184 // Information Panel
185 init();
186 }
187 showItemInfo();
188 }
189 }
190
191 void InformationPanel::resizeEvent(QResizeEvent* event)
192 {
193 if (isVisible()) {
194 // If the text inside the name label or the info label cannot
195 // get wrapped, then the maximum width of the label is increased
196 // so that the width of the information panel gets increased.
197 // To prevent this, the maximum width is adjusted to
198 // the current width of the panel.
199 const int maxWidth = event->size().width() - KDialog::spacingHint() * 4;
200 m_nameLabel->setMaximumWidth(maxWidth);
201
202 // try to increase the preview as large as possible
203 m_preview->setSizeHint(QSize(maxWidth, maxWidth));
204 m_urlCandidate = m_shownUrl; // reset the URL candidate if a resizing is done
205 m_infoTimer->start();
206 }
207 Panel::resizeEvent(event);
208 }
209
210 bool InformationPanel::eventFilter(QObject* obj, QEvent* event)
211 {
212 // Check whether the size of the meta text area has changed and adjust
213 // the fixed width in a way that no horizontal scrollbar needs to be shown.
214 if ((obj == m_metaTextArea->viewport()) && (event->type() == QEvent::Resize)) {
215 QResizeEvent* resizeEvent = static_cast<QResizeEvent*>(event);
216 m_metaTextLabel->setFixedWidth(resizeEvent->size().width());
217 }
218 return Panel::eventFilter(obj, event);
219 }
220
221 void InformationPanel::contextMenuEvent(QContextMenuEvent* event)
222 {
223 Panel::contextMenuEvent(event);
224
225 #ifdef HAVE_NEPOMUK
226 if (showMultipleSelectionInfo()) {
227 return;
228 }
229
230 KMenu popup(this);
231
232 QAction* ratingAction = popup.addAction(i18nc("@action:inmenu", "Rating"));
233 ratingAction->setCheckable(true);
234 ratingAction->setChecked(InformationPanelSettings::showRating());
235
236 QAction* commentAction = popup.addAction(i18nc("@action:inmenu", "Comment"));
237 commentAction->setCheckable(true);
238 commentAction->setChecked(InformationPanelSettings::showComment());
239
240 QAction* tagsAction = popup.addAction(i18nc("@action:inmenu", "Tags"));
241 tagsAction->setCheckable(true);
242 tagsAction->setChecked(InformationPanelSettings::showTags());
243
244 KConfig config("kmetainformationrc", KConfig::NoGlobals);
245 KConfigGroup settings = config.group("Show");
246 initMetaInfoSettings(settings);
247
248 QList<QAction*> actions;
249
250 // Get all meta information labels that are available for
251 // the currently shown file item and add them to the popup.
252 Nepomuk::Resource res(fileItem().url());
253 QHash<QUrl, Nepomuk::Variant> properties = res.properties();
254 QHash<QUrl, Nepomuk::Variant>::const_iterator it = properties.constBegin();
255 while (it != properties.constEnd()) {
256 Nepomuk::Types::Property prop(it.key());
257 const QString key = prop.label();
258
259 // Meta information provided by Nepomuk that is already
260 // available from KFileItem should not be configurable.
261 bool skip = (key == "fileExtension") ||
262 (key == "name") ||
263 (key == "sourceModified") ||
264 (key == "size") ||
265 (key == "mime type");
266 if (!skip) {
267 // Check whether there is already a meta information
268 // having the same label. In this case don't show it
269 // twice in the menu.
270 foreach (const QAction* action, actions) {
271 if (action->data().toString() == key) {
272 skip = true;
273 break;
274 }
275 }
276 }
277
278 if (!skip) {
279 const QString label = key; // TODO
280 QAction* action = new QAction(label, &popup);
281 action->setCheckable(true);
282 action->setChecked(settings.readEntry(key, true));
283 action->setData(key);
284 actions.append(action);
285 }
286
287 ++it;
288 }
289
290 if (actions.count() > 0) {
291 popup.addSeparator();
292
293 // add all items alphabetically sorted to the popup
294 qSort(actions.begin(), actions.end(), lessThan);
295 foreach (QAction* action, actions) {
296 popup.addAction(action);
297 }
298 }
299
300 // Open the popup and adjust the settings for the
301 // selected action.
302 QAction* action = popup.exec(QCursor::pos());
303 if (action == 0) {
304 return;
305 }
306
307 if (action == ratingAction) {
308 // TODO
309 } else if (action == commentAction) {
310 // TODO
311 } else if (action == tagsAction) {
312 // TODO
313 } else {
314 settings.writeEntry(action->data().toString(), action->isChecked());
315 settings.sync();
316 showMetaInfo();
317 }
318 #endif
319 }
320
321 void InformationPanel::showItemInfo()
322 {
323 if (!isVisible()) {
324 return;
325 }
326
327 cancelRequest();
328
329 if (showMultipleSelectionInfo()) {
330 KIconLoader iconLoader;
331 QPixmap icon = iconLoader.loadIcon("dialog-information",
332 KIconLoader::NoGroup,
333 KIconLoader::SizeEnormous);
334 m_preview->setPixmap(icon);
335 setNameLabelText(i18ncp("@info", "%1 item selected", "%1 items selected", m_selection.count()));
336 m_shownUrl = KUrl();
337 } else {
338 const KFileItem item = fileItem();
339 const KUrl itemUrl = item.url();
340 if (!applyPlace(itemUrl)) {
341 // try to get a preview pixmap from the item...
342 m_pendingPreview = true;
343
344 // Mark the currently shown preview as outdated. This is done
345 // with a small delay to prevent a flickering when the next preview
346 // can be shown within a short timeframe.
347 m_outdatedPreviewTimer->start();
348
349 KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << item,
350 m_preview->width(),
351 m_preview->height(),
352 0,
353 0,
354 false,
355 true);
356
357 connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)),
358 this, SLOT(showPreview(const KFileItem&, const QPixmap&)));
359 connect(job, SIGNAL(failed(const KFileItem&)),
360 this, SLOT(showIcon(const KFileItem&)));
361
362 setNameLabelText(itemUrl.fileName());
363 }
364 }
365
366 showMetaInfo();
367 }
368
369 void InformationPanel::slotInfoTimeout()
370 {
371 m_shownUrl = m_urlCandidate;
372 showItemInfo();
373 }
374
375 void InformationPanel::markOutdatedPreview()
376 {
377 KIconEffect iconEffect;
378 QPixmap disabledPixmap = iconEffect.apply(m_preview->pixmap(),
379 KIconLoader::Desktop,
380 KIconLoader::DisabledState);
381 m_preview->setPixmap(disabledPixmap);
382 }
383
384 void InformationPanel::showIcon(const KFileItem& item)
385 {
386 m_outdatedPreviewTimer->stop();
387 m_pendingPreview = false;
388 if (!applyPlace(item.url())) {
389 m_preview->setPixmap(item.pixmap(KIconLoader::SizeEnormous));
390 }
391 }
392
393 void InformationPanel::showPreview(const KFileItem& item,
394 const QPixmap& pixmap)
395 {
396 m_outdatedPreviewTimer->stop();
397
398 Q_UNUSED(item);
399 if (m_pendingPreview) {
400 m_preview->setPixmap(pixmap);
401 m_pendingPreview = false;
402 }
403 }
404
405 void InformationPanel::slotFileRenamed(const QString& source, const QString& dest)
406 {
407 const KUrl sourceUrl = KUrl(source);
408
409 // Verify whether the renamed item is selected. If this is the case, the
410 // selection must be updated with the renamed item.
411 bool isSelected = false;
412 for (int i = m_selection.size() - 1; i >= 0; --i) {
413 if (m_selection[i].url() == sourceUrl) {
414 m_selection.removeAt(i);
415 isSelected = true;
416 break;
417 }
418 }
419
420 if ((m_shownUrl == sourceUrl) || isSelected) {
421 m_shownUrl = KUrl(dest);
422 m_fileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_shownUrl);
423 if (isSelected) {
424 m_selection.append(m_fileItem);
425 }
426 showItemInfo();
427 }
428 }
429
430 void InformationPanel::slotFilesAdded(const QString& directory)
431 {
432 if (m_shownUrl == KUrl(directory)) {
433 // If the 'trash' icon changes because the trash has been emptied or got filled,
434 // the signal filesAdded("trash:/") will be emitted.
435 KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory));
436 requestDelayedItemInfo(item);
437 }
438 }
439
440 void InformationPanel::slotFilesChanged(const QStringList& files)
441 {
442 foreach (const QString& fileName, files) {
443 if (m_shownUrl == KUrl(fileName)) {
444 showItemInfo();
445 break;
446 }
447 }
448 }
449
450 void InformationPanel::slotFilesRemoved(const QStringList& files)
451 {
452 foreach (const QString& fileName, files) {
453 if (m_shownUrl == KUrl(fileName)) {
454 // the currently shown item has been removed, show
455 // the parent directory as fallback
456 reset();
457 break;
458 }
459 }
460 }
461
462 void InformationPanel::slotEnteredDirectory(const QString& directory)
463 {
464 if (m_shownUrl == KUrl(directory)) {
465 KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory));
466 requestDelayedItemInfo(item);
467 }
468 }
469
470 void InformationPanel::slotLeftDirectory(const QString& directory)
471 {
472 if (m_shownUrl == KUrl(directory)) {
473 // The signal 'leftDirectory' is also emitted when a media
474 // has been unmounted. In this case no directory change will be
475 // done in Dolphin, but the Information Panel must be updated to
476 // indicate an invalid directory.
477 reset();
478 }
479 }
480
481 bool InformationPanel::applyPlace(const KUrl& url)
482 {
483 KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
484 int count = placesModel->rowCount();
485
486 for (int i = 0; i < count; ++i) {
487 QModelIndex index = placesModel->index(i, 0);
488
489 if (url.equals(placesModel->url(index), KUrl::CompareWithoutTrailingSlash)) {
490 setNameLabelText(placesModel->text(index));
491 m_preview->setPixmap(placesModel->icon(index).pixmap(128, 128));
492 return true;
493 }
494 }
495
496 return false;
497 }
498
499 void InformationPanel::cancelRequest()
500 {
501 m_infoTimer->stop();
502 }
503
504 void InformationPanel::showMetaInfo()
505 {
506 m_metaTextLabel->clear();
507
508 if (showMultipleSelectionInfo()) {
509 if (m_metaDataWidget != 0) {
510 KUrl::List urls;
511 foreach (const KFileItem& item, m_selection) {
512 urls.append(item.targetUrl());
513 }
514 m_metaDataWidget->setFiles(urls);
515 }
516
517 quint64 totalSize = 0;
518 foreach (const KFileItem& item, m_selection) {
519 // Only count the size of files, not dirs to match what
520 // DolphinViewContainer::selectionStatusBarText() does.
521 if (!item.isDir() && !item.isLink()) {
522 totalSize += item.size();
523 }
524 }
525 m_metaTextLabel->add(i18nc("@label", "Total size:"), KIO::convertSize(totalSize));
526
527 delete m_phononWidget;
528 m_phononWidget = 0;
529 } else {
530 const KFileItem item = fileItem();
531 if (item.isDir()) {
532 m_metaTextLabel->add(i18nc("@label", "Type:"), i18nc("@label", "Folder"));
533 m_metaTextLabel->add(i18nc("@label", "Modified:"), item.timeString());
534 } else {
535 m_metaTextLabel->add(i18nc("@label", "Type:"), item.mimeComment());
536
537 m_metaTextLabel->add(i18nc("@label", "Size:"), KIO::convertSize(item.size()));
538 m_metaTextLabel->add(i18nc("@label", "Modified:"), item.timeString());
539
540 #ifdef HAVE_NEPOMUK
541 KConfig config("kmetainformationrc", KConfig::NoGlobals);
542 KConfigGroup settings = config.group("Show");
543 initMetaInfoSettings(settings);
544
545 Nepomuk::Resource res(item.url());
546
547 QHash<QUrl, Nepomuk::Variant> properties = res.properties();
548 QHash<QUrl, Nepomuk::Variant>::const_iterator it = properties.constBegin();
549 while (it != properties.constEnd()) {
550 Nepomuk::Types::Property prop(it.key());
551 const QString label = prop.label();
552 if (settings.readEntry(label, true)) {
553 // TODO: use Nepomuk::formatValue(res, prop) if available
554 // instead of it.value().toString()
555 m_metaTextLabel->add(label, it.value().toString());
556 }
557 ++it;
558 }
559 #endif
560 }
561
562 if (m_metaDataWidget != 0) {
563 m_metaDataWidget->setFile(item.targetUrl());
564 }
565
566 if (Phonon::BackendCapabilities::isMimeTypeAvailable(item.mimetype())) {
567 if (m_phononWidget == 0) {
568 m_phononWidget = new PhononWidget(this);
569
570 QVBoxLayout* vBoxLayout = qobject_cast<QVBoxLayout*>(layout());
571 Q_ASSERT(vBoxLayout != 0);
572 vBoxLayout->insertWidget(3, m_phononWidget);
573 }
574 m_phononWidget->setUrl(item.url());
575 } else {
576 delete m_phononWidget;
577 m_phononWidget = 0;
578 }
579 }
580 }
581
582 KFileItem InformationPanel::fileItem() const
583 {
584 if (!m_fileItem.isNull()) {
585 return m_fileItem;
586 }
587
588 if (!m_selection.isEmpty()) {
589 Q_ASSERT(m_selection.count() == 1);
590 return m_selection.first();
591 }
592
593 // no item is hovered and no selection has been done: provide
594 // an item for the directory represented by m_shownUrl
595 KFileItem item(KFileItem::Unknown, KFileItem::Unknown, m_shownUrl);
596 item.refresh();
597 return item;
598 }
599
600 bool InformationPanel::showMultipleSelectionInfo() const
601 {
602 return m_fileItem.isNull() && (m_selection.count() > 1);
603 }
604
605 bool InformationPanel::isEqualToShownUrl(const KUrl& url) const
606 {
607 return m_shownUrl.equals(url, KUrl::CompareWithoutTrailingSlash);
608 }
609
610 void InformationPanel::setNameLabelText(const QString& text)
611 {
612 QTextOption textOption;
613 textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
614
615 QTextLayout textLayout(text);
616 textLayout.setFont(m_nameLabel->font());
617 textLayout.setTextOption(textOption);
618
619 QString wrappedText;
620 wrappedText.reserve(text.length());
621
622 // wrap the text to fit into the width of m_nameLabel
623 textLayout.beginLayout();
624 QTextLine line = textLayout.createLine();
625 while (line.isValid()) {
626 line.setLineWidth(m_nameLabel->width());
627 wrappedText += text.mid(line.textStart(), line.textLength());
628
629 line = textLayout.createLine();
630 if (line.isValid()) {
631 wrappedText += QChar::LineSeparator;
632 }
633 }
634 textLayout.endLayout();
635
636 m_nameLabel->setText(wrappedText);
637 }
638
639 void InformationPanel::reset()
640 {
641 m_selection.clear();
642 m_shownUrl = url();
643 m_fileItem = KFileItem();
644 showItemInfo();
645 }
646
647 void InformationPanel::initMetaInfoSettings(KConfigGroup& group)
648 {
649 if (!group.readEntry("initialized", false)) {
650 // The resource file is read the first time. Assure
651 // that some meta information is disabled per default.
652 group.writeEntry("fileExtension", false);
653 group.writeEntry("url", false);
654 group.writeEntry("sourceModified", false);
655 group.writeEntry("parentUrl", false);
656 group.writeEntry("size", false);
657 group.writeEntry("mime type", false);
658 group.writeEntry("depth", false);
659 group.writeEntry("name", false);
660
661 // mark the group as initialized
662 group.writeEntry("initialized", true);
663 }
664 }
665
666 void InformationPanel::init()
667 {
668 const int spacing = KDialog::spacingHint();
669
670 m_infoTimer = new QTimer(this);
671 m_infoTimer->setInterval(300);
672 m_infoTimer->setSingleShot(true);
673 connect(m_infoTimer, SIGNAL(timeout()),
674 this, SLOT(slotInfoTimeout()));
675
676 // Initialize timer for disabling an outdated preview with a small
677 // delay. This prevents flickering if the new preview can be generated
678 // within a very small timeframe.
679 m_outdatedPreviewTimer = new QTimer(this);
680 m_outdatedPreviewTimer->setInterval(300);
681 m_outdatedPreviewTimer->setSingleShot(true);
682 connect(m_outdatedPreviewTimer, SIGNAL(timeout()),
683 this, SLOT(markOutdatedPreview()));
684
685 QVBoxLayout* layout = new QVBoxLayout;
686 layout->setSpacing(spacing);
687
688 // name
689 m_nameLabel = new QLabel(this);
690 QFont font = m_nameLabel->font();
691 font.setBold(true);
692 m_nameLabel->setFont(font);
693 m_nameLabel->setAlignment(Qt::AlignHCenter);
694 m_nameLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
695
696 // preview
697 m_preview = new PixmapViewer(this);
698 m_preview->setMinimumWidth(KIconLoader::SizeEnormous + KIconLoader::SizeMedium);
699 m_preview->setMinimumHeight(KIconLoader::SizeEnormous);
700
701 if (MetaDataWidget::metaDataAvailable()) {
702 // rating, comment and tags
703 m_metaDataWidget = new MetaDataWidget(this);
704 m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
705 }
706
707 // general meta text information
708 m_metaTextLabel = new MetaTextLabel(this);
709 m_metaTextLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
710
711 m_metaTextArea = new QScrollArea(this);
712 m_metaTextArea->setWidget(m_metaTextLabel);
713 m_metaTextArea->setWidgetResizable(true);
714 m_metaTextArea->setFrameShape(QFrame::NoFrame);
715
716 QWidget* viewport = m_metaTextArea->viewport();
717 viewport->installEventFilter(this);
718
719 QPalette palette = viewport->palette();
720 palette.setColor(viewport->backgroundRole(), QColor(Qt::transparent));
721 viewport->setPalette(palette);
722
723 layout->addWidget(m_nameLabel);
724 layout->addWidget(new KSeparator(this));
725 layout->addWidget(m_preview);
726 layout->addWidget(new KSeparator(this));
727 if (m_metaDataWidget != 0) {
728 layout->addWidget(m_metaDataWidget);
729 layout->addWidget(new KSeparator(this));
730 }
731 layout->addWidget(m_metaTextArea);
732 setLayout(layout);
733
734 org::kde::KDirNotify* dirNotify = new org::kde::KDirNotify(QString(), QString(),
735 QDBusConnection::sessionBus(), this);
736 connect(dirNotify, SIGNAL(FileRenamed(QString, QString)), SLOT(slotFileRenamed(QString, QString)));
737 connect(dirNotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString)));
738 connect(dirNotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList)));
739 connect(dirNotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList)));
740 connect(dirNotify, SIGNAL(enteredDirectory(QString)), SLOT(slotEnteredDirectory(QString)));
741 connect(dirNotify, SIGNAL(leftDirectory(QString)), SLOT(slotLeftDirectory(QString)));
742
743 m_initialized = true;
744 }
745
746 #include "informationpanel.moc"