]> git.sesse.net Git - kdenlive/commitdiff
Add config option to enable/disable Nepomuk integration (Desktop search)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 9 Sep 2008 09:54:42 +0000 (09:54 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 9 Sep 2008 09:54:42 +0000 (09:54 +0000)
svn path=/branches/KDE4/; revision=2393

src/kdenlivesettings.kcfg
src/projectlist.cpp
src/widgets/configenv_ui.ui

index 619f2b0490c0f7106ec2beb5b43d6d867e6eebd0..8bc071eec0fb1507ae91342a53a5fd499cc1c5e7 100644 (file)
   </group>
 
   <group name="env">
+    <entry name="activate_nepomuk" type="Bool">
+      <label>Integration with Desktop Search (Nepomuk).</label>
+      <default>false</default>
+    </entry>
+
     <entry name="mltpath" type="Path">
       <label>Mlt framework install path.</label>
       <default></default>
index 53037156d202be7a34b1798099d0c3946cca1ae6..95152d9222c626c7ca70d0d1dcc1dd11b3def42f 100644 (file)
@@ -162,10 +162,15 @@ void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QSt
     if (properties.contains("description")) {
         CLIPTYPE type = clip->clipType();
         clip->setText(2, properties.value("description"));
-        if (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST) {
+        if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
             // Use Nepomuk system to store clip description
             Nepomuk::Resource f(clip->clipUrl().path());
-            if (f.isValid()) f.setDescription(properties.value("description"));
+            if (f.isValid()) {
+                f.setDescription(properties.value("description"));
+            } else {
+                KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", clip->clipUrl().path()));
+                KdenliveSettings::setActivate_nepomuk(false);
+            }
         }
         emit projectModified();
     }
@@ -282,7 +287,7 @@ void ProjectList::slotAddClip(DocClipBase *clip) {
     if (item == NULL) item = new ProjectItem(listView, clip);
 
     KUrl url = clip->fileURL();
-    if (!url.isEmpty()) {
+    if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
         // if file has Nepomuk comment, use it
         Nepomuk::Resource f(url.path());
         QString annotation;
@@ -291,7 +296,10 @@ void ProjectList::slotAddClip(DocClipBase *clip) {
             /*
             Nepomuk::Tag tag("test");
             f.addTag(tag);*/
-        } else kDebug() << "---  CANNOT CONTACT NEPOMUK";
+        } else {
+            KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", url.path()));
+            KdenliveSettings::setActivate_nepomuk(false);
+        }
         if (!annotation.isEmpty()) item->setText(2, annotation);
     }
     emit getFileProperties(clip->toXML(), clip->getId());
index 20293758f0ab3e1bd40b068d7b84715579424dd6..a4aa2ab7c828411f12f2f1a202cbd06959c4cb8b 100644 (file)
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>342</width>
-    <height>378</height>
+    <width>304</width>
+    <height>236</height>
    </rect>
   </property>
-  <layout class="QGridLayout" name="gridLayout_4" >
+  <layout class="QGridLayout" name="gridLayout" >
    <item row="0" column="0" >
-    <widget class="QGroupBox" name="groupBox" >
-     <property name="title" >
-      <string>Mlt environment</string>
+    <widget class="QCheckBox" name="kcfg_activate_nepomuk" >
+     <property name="text" >
+      <string>Desktop search integration</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout" >
-      <item row="0" column="0" >
-       <widget class="QLabel" name="label" >
-        <property name="text" >
-         <string>Mlt profiles folder</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1" >
-       <widget class="KUrlRequester" name="mltpathurl" />
-      </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="label_2" >
-        <property name="text" >
-         <string>Inigo path</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1" >
-       <widget class="KUrlRequester" name="rendererpathurl" />
-      </item>
-     </layout>
     </widget>
    </item>
    <item row="1" column="0" >
-    <widget class="QGroupBox" name="groupBox_2" >
-     <property name="title" >
-      <string>Default folders</string>
+    <widget class="QTabWidget" name="tabWidget" >
+     <property name="currentIndex" >
+      <number>0</number>
      </property>
-     <layout class="QGridLayout" name="gridLayout_2" >
-      <item row="0" column="0" >
-       <widget class="QLabel" name="label_3" >
-        <property name="text" >
-         <string>Temporary files</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1" >
-       <widget class="KUrlRequester" name="tmppathurl" />
-      </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="label_10" >
-        <property name="text" >
-         <string>Capture folder</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1" >
-       <widget class="KUrlRequester" name="capturefolderurl" />
-      </item>
-     </layout>
+     <widget class="QWidget" name="tab" >
+      <attribute name="title" >
+       <string>Mlt environment</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_4" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="label" >
+         <property name="text" >
+          <string>Mlt profiles folder</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" >
+        <widget class="KUrlRequester" name="mltpathurl" />
+       </item>
+       <item row="1" column="0" >
+        <widget class="QLabel" name="label_2" >
+         <property name="text" >
+          <string>Inigo path</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="KUrlRequester" name="rendererpathurl" />
+       </item>
+       <item row="2" column="1" >
+        <spacer name="verticalSpacer_2" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2" >
+      <attribute name="title" >
+       <string>Default folders</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_5" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="label_3" >
+         <property name="text" >
+          <string>Temporary files</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" >
+        <widget class="KUrlRequester" name="tmppathurl" />
+       </item>
+       <item row="1" column="0" >
+        <widget class="QLabel" name="label_10" >
+         <property name="text" >
+          <string>Capture folder</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="KUrlRequester" name="capturefolderurl" />
+       </item>
+       <item row="2" column="1" >
+        <spacer name="verticalSpacer_3" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_3" >
+      <attribute name="title" >
+       <string>Default apps</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_6" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="label_4" >
+         <property name="text" >
+          <string>Image editing</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" >
+        <widget class="KLineEdit" name="kcfg_defaultimageapp" >
+         <property name="showClearButton" stdset="0" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2" >
+        <widget class="KPushButton" name="kp_image" >
+         <property name="text" >
+          <string>Change</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0" >
+        <widget class="QLabel" name="label_11" >
+         <property name="text" >
+          <string>Audio editing</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="KLineEdit" name="kcfg_defaultaudioapp" >
+         <property name="showClearButton" stdset="0" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2" >
+        <widget class="KPushButton" name="kp_audio" >
+         <property name="text" >
+          <string>Change</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" >
+        <widget class="QLabel" name="label_12" >
+         <property name="text" >
+          <string>Video player</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" >
+        <widget class="KLineEdit" name="kcfg_defaultplayerapp" >
+         <property name="showClearButton" stdset="0" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2" >
+        <widget class="KPushButton" name="kp_player" >
+         <property name="text" >
+          <string>Change</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1" >
+        <spacer name="verticalSpacer_4" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
-   <item row="2" column="0" >
-    <widget class="QGroupBox" name="groupBox_3" >
-     <property name="title" >
-      <string>Default apps</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_3" >
-      <item row="0" column="0" >
-       <widget class="QLabel" name="label_4" >
-        <property name="text" >
-         <string>Image editing</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1" >
-       <widget class="KLineEdit" name="kcfg_defaultimageapp" >
-        <property name="showClearButton" stdset="0" >
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2" >
-       <widget class="KPushButton" name="kp_image" >
-        <property name="text" >
-         <string>Change</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="label_11" >
-        <property name="text" >
-         <string>Audio editing</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1" >
-       <widget class="KLineEdit" name="kcfg_defaultaudioapp" >
-        <property name="showClearButton" stdset="0" >
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="2" >
-       <widget class="KPushButton" name="kp_audio" >
-        <property name="text" >
-         <string>Change</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0" >
-       <widget class="QLabel" name="label_12" >
-        <property name="text" >
-         <string>Video player</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1" >
-       <widget class="KLineEdit" name="kcfg_defaultplayerapp" >
-        <property name="showClearButton" stdset="0" >
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="2" >
-       <widget class="KPushButton" name="kp_player" >
-        <property name="text" >
-         <string>Change</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="3" column="0" >
-    <spacer name="verticalSpacer" >
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>20</width>
-       <height>56</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <customwidgets>