Commit 487d6dd5 authored by Vishesh Handa's avatar Vishesh Handa

Dolphin Information Panel: Use Nepomuk2::FileMetadataWidget

Instead of the KFileMetadataWidget. The Nepomuk widget is just a copy of
the KFileMetadataWidget which utilizes Nepomuk2.
parent b3d90a1c
macro_optional_find_package(Soprano)
macro_optional_find_package(NepomukCore)
macro_optional_find_package(NepomukWidgets)
macro_log_feature(NepomukCore_FOUND "Nepomuk" "Nepomuk" "http://www.kde.org" FALSE "" "For adding desktop-wide tagging support to dolphin")
macro_bool_to_01(NepomukCore_FOUND HAVE_NEPOMUK)
configure_file(config-nepomuk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-nepomuk.h )
......@@ -11,7 +12,7 @@ include_directories( ${KACTIVITIES_INCLUDE_DIRS} )
if (NepomukCore_FOUND)
# Yes, Soprano includes is what we need here
include_directories( ${SOPRANO_INCLUDE_DIR} ${NEPOMUK_CORE_INCLUDE_DIR} )
include_directories( ${SOPRANO_INCLUDE_DIR} ${NEPOMUK_CORE_INCLUDE_DIR} ${NEPOMUK_WIDGETS_INCLUDE_DIR} )
endif (NepomukCore_FOUND)
add_subdirectory(tests)
......@@ -103,6 +104,7 @@ if (NepomukCore_FOUND)
target_link_libraries(
dolphinprivate
${NEPOMUK_CORE_LIBRARY}
${NEPOMUK_WIDGETS_LIBRARY}
${SOPRANO_LIBRARIES}
)
endif (NepomukCore_FOUND)
......@@ -228,6 +230,7 @@ target_link_libraries(kdeinit_dolphin
if (NepomukCore_FOUND)
target_link_libraries(kdeinit_dolphin
${NEPOMUK_CORE_LIBRARY}
${NEPOMUK_WIDGETS_LIBRARY}
${SOPRANO_LIBRARIES}
)
endif (NepomukCore_FOUND)
......@@ -302,10 +305,10 @@ target_link_libraries(kcm_dolphinnavigation ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIB
target_link_libraries(kcm_dolphinservices ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KNEWSTUFF3_LIBRARY} dolphinprivate)
target_link_libraries(kcm_dolphingeneral ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} dolphinprivate)
if (NepomukCore_FOUND)
target_link_libraries(kcm_dolphinviewmodes ${NEPOMUK_CORE_LIBRARY})
target_link_libraries(kcm_dolphinnavigation ${NEPOMUK_CORE_LIBRARY})
target_link_libraries(kcm_dolphinservices ${NEPOMUK_CORE_LIBRARY})
target_link_libraries(kcm_dolphingeneral ${NEPOMUK_CORE_LIBRARY})
target_link_libraries(kcm_dolphinviewmodes ${NEPOMUK_CORE_LIBRARY} ${NEPOMUK_WIDGETS_LIBRARY})
target_link_libraries(kcm_dolphinnavigation ${NEPOMUK_CORE_LIBRARY} ${NEPOMUK_WIDGETS_LIBRARY})
target_link_libraries(kcm_dolphinservices ${NEPOMUK_CORE_LIBRARY} ${NEPOMUK_WIDGETS_LIBRARY})
target_link_libraries(kcm_dolphingeneral ${NEPOMUK_CORE_LIBRARY} ${NEPOMUK_WIDGETS_LIBRARY})
endif (NepomukCore_FOUND)
install(TARGETS kcm_dolphinviewmodes DESTINATION ${PLUGIN_INSTALL_DIR} )
......
......@@ -21,7 +21,6 @@
#include <KDialog>
#include <KFileItem>
#include <kfilemetadatawidget.h>
#include <KGlobalSettings>
#include <KIO/JobUiDelegate>
#include <KIO/PreviewJob>
......@@ -32,6 +31,8 @@
#include <kseparator.h>
#include <KStringHandler>
#include <nepomuk2/filemetadatawidget.h>
#include <panels/places/placesitem.h>
#include <panels/places/placesitemmodel.h>
......@@ -106,7 +107,7 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
const bool previewsShown = InformationPanelSettings::previewsShown();
m_preview->setVisible(previewsShown);
m_metaDataWidget = new KFileMetaDataWidget(parent);
m_metaDataWidget = new Nepomuk2::FileMetaDataWidget(parent);
m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont());
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
......
......@@ -26,7 +26,6 @@
#include <KVBox>
class KFileItemList;
class KFileMetaDataWidget;
class PhononWidget;
class PixmapViewer;
class PlacesItemModel;
......@@ -35,6 +34,10 @@ class QString;
class QLabel;
class QScrollArea;
namespace Nepomuk2 {
class FileMetaDataWidget;
}
/**
* @brief Manages the widgets that display the meta information
* for file items of the Information Panel.
......@@ -133,7 +136,7 @@ private:
PixmapViewer* m_preview;
PhononWidget* m_phononWidget;
QLabel* m_nameLabel;
KFileMetaDataWidget* m_metaDataWidget;
Nepomuk2::FileMetaDataWidget* m_metaDataWidget;
QScrollArea* m_metaDataArea;
PlacesItemModel* m_placesItemModel;
......
......@@ -22,7 +22,6 @@
#include "filemetadatatooltip.h"
#include <KColorScheme>
#include <kfilemetadatawidget.h>
#include <KSeparator>
#include <KWindowSystem>
......@@ -31,6 +30,8 @@
#include <QStylePainter>
#include <QVBoxLayout>
#include <nepomuk2/filemetadatawidget.h>
// For the blurred tooltip background
#include <plasma/windoweffects.h>
......@@ -55,7 +56,7 @@ FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) :
m_name->setFont(font);
// Create widget for the meta data
m_fileMetaDataWidget = new KFileMetaDataWidget(this);
m_fileMetaDataWidget = new Nepomuk2::FileMetaDataWidget(this);
m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText);
m_fileMetaDataWidget->setReadOnly(true);
connect(m_fileMetaDataWidget, SIGNAL(metaDataRequestFinished(KFileItemList)),
......
......@@ -25,9 +25,12 @@
#include <QWidget>
class KFileItemList;
class KFileMetaDataWidget;
class QLabel;
namespace Nepomuk2 {
class FileMetaDataWidget;
}
/**
* @brief Tooltip, that shows the meta information and a preview of one
* or more files.
......@@ -68,7 +71,7 @@ protected:
private:
QLabel* m_preview;
QLabel* m_name;
KFileMetaDataWidget* m_fileMetaDataWidget;
Nepomuk2::FileMetaDataWidget* m_fileMetaDataWidget;
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment