]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Corrected the compile fix commit, rev 965fc6b3.
authorDawit Alemayehu <adawit@kde.org>
Wed, 12 Sep 2012 19:54:37 +0000 (15:54 -0400)
committerDawit Alemayehu <adawit@kde.org>
Sat, 15 Sep 2012 17:44:54 +0000 (13:44 -0400)
src/CMakeLists.txt
src/dolphinpart.cpp
src/dolphinpart.h
src/dolphinpart_ext.cpp [new file with mode: 0644]
src/dolphinpart_ext.h [new file with mode: 0644]

index afc190f8324785b910d49a360bb4e79b2b11543f..1c6b40c4b49541dce883eecf9621d1d199ddde08 100644 (file)
@@ -131,6 +131,13 @@ set(dolphinpart_SRCS
    dolphinpart.cpp
 )
 
+# Add dolphinpart_ext.cpp conditionally, only with KDE > 4.9.1.
+if (${KDE_VERSION} VERSION_GREATER "4.9.1")
+set(dolphinpart_SRCS
+    ${dolphinpart_SRCS}
+    dolphinpart_ext.cpp)
+endif (${KDE_VERSION} VERSION_GREATER "4.9.1")
+
 kde4_add_plugin(dolphinpart ${dolphinpart_SRCS})
 
 target_link_libraries(dolphinpart dolphinprivate konq ${KDE4_KPARTS_LIBS} ${KDE4_KFILE_LIBS})
index a7e8bffec2f2662a0a4d511b5f30cf791504452e..ccc91fd7ddac6aa2c11a196a376008efd9246968 100644 (file)
 #include <KMenu>
 #include <KInputDialog>
 #include <KProtocolInfo>
+#include <kdeversion.h>
+
+#if KDE_IS_VERSION(4, 9, 2)
+#include "dolphinpart_ext.h"
+#endif
 
 #include "views/dolphinview.h"
 #include "views/dolphinviewactionhandler.h"
@@ -664,86 +669,4 @@ KFileItemList DolphinPartFileInfoExtension::queryFor(KParts::FileInfoExtension::
     return list;
 }
 
-#if KDE_IS_VERSION(4, 9, 2)
-
-DolphinPartListingFilterExtension::DolphinPartListingFilterExtension (DolphinPart* part)
-    : KParts::ListingFilterExtension(part)
-      , m_part(part)
-{
-}
-
-KParts::ListingFilterExtension::FilterModes DolphinPartListingFilterExtension::supportedFilterModes() const
-{
-    return (KParts::ListingFilterExtension::MimeType |
-            KParts::ListingFilterExtension::SubString |
-            KParts::ListingFilterExtension::WildCard);
-}
-
-bool DolphinPartListingFilterExtension::supportsMultipleFilters (KParts::ListingFilterExtension::FilterMode mode) const
-{
-    if (mode == KParts::ListingFilterExtension::MimeType)
-        return true;
-
-    return false;
-}
-
-QVariant DolphinPartListingFilterExtension::filter (KParts::ListingFilterExtension::FilterMode mode) const
-{
-    QVariant result;
-
-    switch (mode) {
-    case KParts::ListingFilterExtension::MimeType:
-        result = m_part->view()->mimeTypeFilters();
-        break;
-    case KParts::ListingFilterExtension::SubString:
-    case KParts::ListingFilterExtension::WildCard:
-        result = m_part->view()->nameFilter();
-        break;
-    default:
-      break;
-    }
-
-    return result;
-}
-
-void DolphinPartListingFilterExtension::setFilter (KParts::ListingFilterExtension::FilterMode mode, const QVariant& filter)
-{
-    switch (mode) {
-    case KParts::ListingFilterExtension::MimeType:
-        m_part->view()->setMimeTypeFilters(filter.toStringList());
-        break;
-    case KParts::ListingFilterExtension::SubString:
-    case KParts::ListingFilterExtension::WildCard:
-        m_part->view()->setNameFilter(filter.toString());
-        break;
-    default:
-      break;
-    }
-}
-
-////
-
-DolphinPartListingNotificationExtension::DolphinPartListingNotificationExtension(DolphinPart* part)
-    :KParts::ListingNotificationExtension(part)
-{
-}
-
-KParts::ListingNotificationExtension::NotificationEventTypes DolphinPartListingNotificationExtension::supportedNotificationEventTypes() const
-{
-    return (KParts::ListingNotificationExtension::ItemsAdded |
-            KParts::ListingNotificationExtension::ItemsDeleted);
-}
-
-void DolphinPartListingNotificationExtension::slotNewItems(const KFileItemList& items)
-{
-    emit listingEvent(KParts::ListingNotificationExtension::ItemsAdded, items);
-}
-
-void DolphinPartListingNotificationExtension::slotItemsDeleted(const KFileItemList& items)
-{
-    emit listingEvent(KParts::ListingNotificationExtension::ItemsDeleted, items);
-}
-
-#endif
-
 #include "dolphinpart.moc"
index 0895686b837c0cf6830d2f802f1be926664c85b3..e5693b363744a06937dc065a0d1165fafc30972b 100644 (file)
 #ifndef DOLPHINPART_H
 #define DOLPHINPART_H
 
-#include <kdeversion.h>
-
 #include <kparts/part.h>
 #include <kparts/browserextension.h>
 #include <kparts/fileinfoextension.h>
 
-#if KDE_IS_VERSION(4, 9, 2)
-#include <kparts/listingextension.h>
-#endif
-
 #include <QItemSelectionModel>
 
 class KNewFileMenu;
@@ -287,34 +281,4 @@ protected:
     DolphinPart* part() const;
 };
 
-#if KDE_IS_VERSION(4, 9, 2)
-class DolphinPartListingFilterExtension : public KParts::ListingFilterExtension
-{
-    Q_OBJECT
-
-public:
-    DolphinPartListingFilterExtension (DolphinPart* part);
-    virtual FilterModes supportedFilterModes() const;
-    virtual bool supportsMultipleFilters (FilterMode mode) const;
-    virtual QVariant filter (FilterMode mode) const;
-    virtual void setFilter (FilterMode mode, const QVariant& filter);
-
-private:
-    DolphinPart* m_part;
-};
-
-class DolphinPartListingNotificationExtension : public KParts::ListingNotificationExtension
-{
-    Q_OBJECT
-
-public:
-    DolphinPartListingNotificationExtension(DolphinPart* part);
-    virtual NotificationEventTypes supportedNotificationEventTypes() const;
-
-public Q_SLOTS:
-   void slotNewItems(const KFileItemList&);
-   void slotItemsDeleted(const KFileItemList&);
-};
-#endif
-
 #endif /* DOLPHINPART_H */
diff --git a/src/dolphinpart_ext.cpp b/src/dolphinpart_ext.cpp
new file mode 100644 (file)
index 0000000..e98c064
--- /dev/null
@@ -0,0 +1,107 @@
+/* This file is part of the KDE project
+ * Copyright (c) 2012 Dawit Alemayehu <adawit@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "dolphinpart_ext.h"
+
+#include "dolphinpart.h"
+#include "views/dolphinview.h"
+
+#include <QVariant>
+
+#include <KFileItemList>
+
+DolphinPartListingFilterExtension::DolphinPartListingFilterExtension(DolphinPart* part)
+    : KParts::ListingFilterExtension(part)
+    , m_part(part)
+{
+}
+
+KParts::ListingFilterExtension::FilterModes DolphinPartListingFilterExtension::supportedFilterModes() const
+{
+    return (KParts::ListingFilterExtension::MimeType |
+            KParts::ListingFilterExtension::SubString |
+            KParts::ListingFilterExtension::WildCard);
+}
+
+bool DolphinPartListingFilterExtension::supportsMultipleFilters(KParts::ListingFilterExtension::FilterMode mode) const
+{
+    if (mode == KParts::ListingFilterExtension::MimeType)
+        return true;
+
+    return false;
+}
+
+QVariant DolphinPartListingFilterExtension::filter(KParts::ListingFilterExtension::FilterMode mode) const
+{
+    QVariant result;
+
+    switch (mode) {
+    case KParts::ListingFilterExtension::MimeType:
+        result = m_part->view()->mimeTypeFilters();
+        break;
+    case KParts::ListingFilterExtension::SubString:
+    case KParts::ListingFilterExtension::WildCard:
+        result = m_part->view()->nameFilter();
+        break;
+    default:
+        break;
+    }
+
+    return result;
+}
+
+void DolphinPartListingFilterExtension::setFilter(KParts::ListingFilterExtension::FilterMode mode, const QVariant& filter)
+{
+    switch (mode) {
+    case KParts::ListingFilterExtension::MimeType:
+        m_part->view()->setMimeTypeFilters(filter.toStringList());
+        break;
+    case KParts::ListingFilterExtension::SubString:
+    case KParts::ListingFilterExtension::WildCard:
+        m_part->view()->setNameFilter(filter.toString());
+        break;
+    default:
+        break;
+    }
+}
+
+////
+
+DolphinPartListingNotificationExtension::DolphinPartListingNotificationExtension(DolphinPart* part)
+    : KParts::ListingNotificationExtension(part)
+{
+}
+
+KParts::ListingNotificationExtension::NotificationEventTypes DolphinPartListingNotificationExtension::supportedNotificationEventTypes() const
+{
+    return (KParts::ListingNotificationExtension::ItemsAdded |
+            KParts::ListingNotificationExtension::ItemsDeleted);
+}
+
+void DolphinPartListingNotificationExtension::slotNewItems(const KFileItemList& items)
+{
+    emit listingEvent(KParts::ListingNotificationExtension::ItemsAdded, items);
+}
+
+void DolphinPartListingNotificationExtension::slotItemsDeleted(const KFileItemList& items)
+{
+    emit listingEvent(KParts::ListingNotificationExtension::ItemsDeleted, items);
+}
+
+#include "dolphinpart_ext.moc"
diff --git a/src/dolphinpart_ext.h b/src/dolphinpart_ext.h
new file mode 100644 (file)
index 0000000..423e79e
--- /dev/null
@@ -0,0 +1,56 @@
+/* This file is part of the KDE project
+ * Copyright (c) 2012 Dawit Alemayehu <adawit@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef DOLPHINPART_EXT_H
+#define DOLPHINPART_EXT_H
+
+
+#include <kparts/listingextension.h>
+
+class DolphinPart;
+
+class DolphinPartListingFilterExtension : public KParts::ListingFilterExtension
+{
+    Q_OBJECT
+
+public:
+    DolphinPartListingFilterExtension(DolphinPart* part);
+    virtual FilterModes supportedFilterModes() const;
+    virtual bool supportsMultipleFilters(FilterMode mode) const;
+    virtual QVariant filter(FilterMode mode) const;
+    virtual void setFilter(FilterMode mode, const QVariant& filter);
+
+private:
+    DolphinPart* m_part;
+};
+
+class DolphinPartListingNotificationExtension : public KParts::ListingNotificationExtension
+{
+    Q_OBJECT
+
+public:
+    DolphinPartListingNotificationExtension(DolphinPart* part);
+    virtual NotificationEventTypes supportedNotificationEventTypes() const;
+
+public Q_SLOTS:
+    void slotNewItems(const KFileItemList&);
+    void slotItemsDeleted(const KFileItemList&);
+};
+
+#endif