[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Exception for Dolphin - KFileMetadataWidget
From:       Vishesh Handa <me () vhanda ! in>
Date:       2012-12-21 11:09:17
Message-ID: CAOPTMKCoHpMwtUA6RvAZMDMkwH-A21-JvQ=Hbz5tdAT-V8orUQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello release team

As most of you must know for KDE 4.9, a new package nepmuk-core was
released, and with 4.10 we are now releasing nepomuk-widgets. The
nepomuk-widgets initially just contained the Tagging and Rating widgets,
which were adapted from kdelibs/nepomuk/ui. I use the word "adapted" cause
their internals were ported to the new asynchronous APIs (which was the
reason nepomuk-core was created)

One of the primary ways users tag and rate files is through the information
panel in Dolphin. The main widget in this panel is the KFileMetadataWidget
(kdelibs/kio/kfile/*). This widget has many problems -

* Uses the old Nepomuk Resource API from kdelibs - very buggy
* Uses the old Nepomuk widgets from kdelibs - slower and not maintained
* Had a multi-process architecture which involved spawning a new process
which provided the Nepomuk / Strigi ** data. This was done cause Strigi is
known to crash a lot.
* Cause of this multi-process architecture it was very slow - specially on
the Nepomuk side cause it would re-create the caches each time the process
was run. This was especially wasteful because Dolphin itself uses Nepomuk
and would have those caches. (The caches are not cross-application)
* Hacking on the widget was hard - Its entire architecture is quite
convoluted.

I wanted to fix this with 4.10, so I copied most of the widget to
nepomuk-widgets and named it Nepomuk2::FileMetadataWidget. This "new"
widget was added in the feature plan [1]. It was never marked as completed
cause it had some bugs, which I did not have the time to fix. It was
however, still merged before the hard feature freeze.

I did not submit my patch to use this widget in Dolphin, as it had some
bugs, and I did not want to spoil Dolphin's experience. In hind-sight maybe
I should have submitted it, and gotten all the bug reports.

Fast forwarding to present time
----------------------------------------------

I finally squashed the last of the bugs in the widget, and made it support
displaying indexing results even when the file was not indexed or Nepomuk
is disabled. The old KFileMetadataWidget had the same capability - It used
Strigi, while we use the new file indexer that I've been working on.

I would like to use this new widget in dolphin for 4.10. I was told to ask
for an exception from the release team. We still have one more release
candidate to go, so it should get adequate testing, if not the full amount.

Other advantages -

* It is a LOT faster - and it feels like it (Patch attached, if you want to
try it out)
* Easier to maintain
* Uses the Nepomuk2 widgets which are actively maintained, and will thus
get the required bug fixes. They have been some bugs filed against Dolphin
and its tagging behaviour, fixing this would be quite hard in
kdelibs/Nepomuk, also I don't want to mess with that code base which barely
gets tested any more.
* Since Dolphin also uses Nepomuk2, and the new widget does not spawn a new
process for the Nepomuk data, it can re-use the already filled caches.
* This gives a much better experience even when Nepomuk is disabled.
* This new widget's internal architecture is a lot better, and it's easy to
modify - So it's easy to improve.

If we do not ship this new widget, I'll have to clean up the
KFileMetadataWidget cause it shows a lot of ugly data like "Resource
Created", arguably this isn't very hard. However it is not something I want
to do. Ditto for kdelibs/nepomuk/*.

So, may I merge my patch into kde-baseapps 4.10? It will get tested more
thoroughly in RC2.

[1] http://techbase.kde.org/Schedules/KDE4/4.10_Feature_Plan

-- 
Vishesh Handa

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hello release \
team<br><br></div>As most of you must know for KDE 4.9, a new package nepmuk-core was \
released, and with 4.10 we are now releasing nepomuk-widgets. The nepomuk-widgets \
initially just contained the Tagging and Rating widgets, which were adapted from \
kdelibs/nepomuk/ui. I use the word &quot;adapted&quot; cause their internals were \
ported to the new asynchronous APIs (which was the reason nepomuk-core was \
created)<br>

<br></div>One of the primary ways users tag and rate files is through the information \
panel in Dolphin. The main widget in this panel is the KFileMetadataWidget \
(kdelibs/kio/kfile/*). This widget has many problems -<br><br>

</div>* Uses the old Nepomuk Resource API from kdelibs - very buggy<br></div>* Uses \
the old Nepomuk widgets from kdelibs - slower and not maintained<br></div>* Had a \
multi-process architecture which involved spawning a new process which provided the \
Nepomuk / Strigi ** data. This was done cause Strigi is known to crash a lot.<br>

</div>* Cause of this multi-process architecture it was very slow - specially on the \
Nepomuk side cause it would re-create the caches each time the process was run. This \
was especially wasteful because Dolphin itself uses Nepomuk and would have those \
caches. (The caches are not cross-application)<br>

</div>* Hacking on the widget was hard - Its entire architecture is quite \
convoluted.<br></div></div><div><div><div><div><br></div><div>I wanted to fix this \
with 4.10, so I copied most of the widget to nepomuk-widgets and named it \
Nepomuk2::FileMetadataWidget. This &quot;new&quot; widget was added in the feature \
plan [1]. It was never marked as completed cause it had some bugs, which I did not \
have the time to fix. It was however, still merged before the hard feature \
freeze.<br>

<br></div><div>I did not submit my patch to use this widget in Dolphin, as it had \
some bugs, and I did not want to spoil Dolphin&#39;s experience. In hind-sight maybe \
I should have submitted it, and gotten all the bug reports.<br>

</div><div><br></div><div>Fast forwarding to present \
time<br>----------------------------------------------<br><br></div><div>I finally \
squashed the last of the bugs in the widget, and made it support displaying indexing \
results even when the file was not indexed or Nepomuk is disabled. The old \
KFileMetadataWidget had the same capability - It used Strigi, while we use the new \
file indexer that I&#39;ve been working on.<br>

<br clear="all"></div><div><div><div><div><div><div><div><div><div><div><div>I would \
like to use this new widget in dolphin for 4.10. I was told to ask for an exception \
from the release team. We still have one more release candidate to go, so it should \
get adequate testing, if not the full amount.<br>

<br></div><div>Other advantages -<br></div><div><br>* It is a LOT faster - and it \
feels like it (Patch attached, if you want to try it out)<br></div><div>* Easier to \
maintain<br></div><div>* Uses the Nepomuk2 widgets which are actively maintained, and \
will thus get the required bug fixes. They have been some bugs filed against Dolphin \
and its tagging behaviour, fixing this would be quite hard in kdelibs/Nepomuk, also I \
don&#39;t want to mess with that code base which barely gets tested any more.<br>

</div><div>* Since Dolphin also uses Nepomuk2, and the new widget does not spawn a \
new process for the Nepomuk data, it can re-use the already filled \
caches.<br></div><div>* This gives a much better experience even when Nepomuk is \
disabled.<br>

</div><div>* This new widget&#39;s internal architecture is a lot better, and \
it&#39;s easy to modify - So it&#39;s easy to \
improve.<br></div><div><br></div><div>If we do not ship this new widget, I&#39;ll \
have to clean up the KFileMetadataWidget cause it shows a lot of ugly data like \
&quot;Resource Created&quot;, arguably this isn&#39;t very hard. However it is not \
something I want to do. Ditto for kdelibs/nepomuk/*.<br>

<br></div><div>So, may I merge my patch into kde-baseapps 4.10? It will get tested \
more thoroughly in RC2.<br></div><div><br>[1] <a \
href="http://techbase.kde.org/Schedules/KDE4/4.10_Feature_Plan" \
target="_blank">http://techbase.kde.org/Schedules/KDE4/4.10_Feature_Plan</a><br> \
<br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br>

</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>


--bcaec54d476604537c04d15ab60f--


["dolphin-nepomuk-widgets.patch" (application/octet-stream)]

diff --git a/dolphin/src/CMakeLists.txt b/dolphin/src/CMakeLists.txt
index f8d2669..b7aa5b3 100644
--- a/dolphin/src/CMakeLists.txt
+++ b/dolphin/src/CMakeLists.txt
@@ -1,5 +1,6 @@
 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} )
diff --git a/dolphin/src/panels/information/informationpanelcontent.cpp \
b/dolphin/src/panels/information/informationpanelcontent.cpp index 39ed1d2..355a571 \
                100644
--- a/dolphin/src/panels/information/informationpanelcontent.cpp
+++ b/dolphin/src/panels/information/informationpanelcontent.cpp
@@ -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)));
diff --git a/dolphin/src/panels/information/informationpanelcontent.h \
b/dolphin/src/panels/information/informationpanelcontent.h index c0412e5..2a369bb \
                100644
--- a/dolphin/src/panels/information/informationpanelcontent.h
+++ b/dolphin/src/panels/information/informationpanelcontent.h
@@ -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;
diff --git a/dolphin/src/views/tooltips/filemetadatatooltip.cpp \
b/dolphin/src/views/tooltips/filemetadatatooltip.cpp index 1f4fb69..d0cba74 100644
--- a/dolphin/src/views/tooltips/filemetadatatooltip.cpp
+++ b/dolphin/src/views/tooltips/filemetadatatooltip.cpp
@@ -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)),
diff --git a/dolphin/src/views/tooltips/filemetadatatooltip.h \
b/dolphin/src/views/tooltips/filemetadatatooltip.h index 856b557..aa7ce63 100644
--- a/dolphin/src/views/tooltips/filemetadatatooltip.h
+++ b/dolphin/src/views/tooltips/filemetadatatooltip.h
@@ -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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic