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

List:       kde-commits
Subject:    KDE/kdelibs/kparts
From:       Kevin Ottens <ervin () kde ! org>
Date:       2010-11-04 8:29:40
Message-ID: 20101104082940.C0C85AC89B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1192882 by ervin:

Remove deprecated symbols from the build (if KDE_NO_DEPRECATED is defined). And port \
the rest away from deprecated API.

 M  +4 -0      browserrun.cpp  
 M  +4 -0      browserrun.h  
 M  +2 -0      mainwindow.cpp  
 M  +2 -0      mainwindow.h  
 M  +4 -0      part.cpp  
 M  +4 -0      part.h  
 M  +12 -2     plugin.cpp  
 M  +4 -0      plugin.h  


--- trunk/KDE/kdelibs/kparts/browserrun.cpp #1192881:1192882
@@ -330,6 +330,7 @@
 }
 
 //static, deprecated
+#ifndef KDE_NO_DEPRECATED
 BrowserRun::AskSaveResult BrowserRun::askSave( const KUrl & url, KService::Ptr \
offer, const QString& mimeType, const QString & suggestedFileName )  {
     Q_UNUSED(offer);
@@ -340,8 +341,10 @@
         : BrowserOpenOrSaveQuestion::Open ? Open
         : Cancel;
 }
+#endif
 
 //static, deprecated
+#ifndef KDE_NO_DEPRECATED
 BrowserRun::AskSaveResult BrowserRun::askEmbedOrSave( const KUrl & url, const \
QString& mimeType, const QString & suggestedFileName, int flags )  {
     BrowserOpenOrSaveQuestion question(0, url, mimeType);
@@ -351,6 +354,7 @@
         : BrowserOpenOrSaveQuestion::Embed ? Open
         : Cancel;
 }
+#endif
 
 // Default implementation, overridden in KHTMLRun
 void BrowserRun::save( const KUrl & url, const QString & suggestedFileName )
--- trunk/KDE/kdelibs/kparts/browserrun.h #1192881:1192882
@@ -91,7 +91,9 @@
          *  const BrowserOpenOrSaveQuestion::Result res = dlg.askOpenOrSave();
          * @endcode
          */
+#ifndef KDE_NO_DEPRECATED
         static KDE_DEPRECATED AskSaveResult askSave( const KUrl & url, KService::Ptr \
offer, const QString& mimeType, const QString & suggestedFileName = QString() ); \
+#endif  
         enum AskEmbedOrSaveFlags { InlineDisposition = 0, AttachmentDisposition = 1 \
};  /**
@@ -109,7 +111,9 @@
          *  // Important: returns Embed now, not Open!
          * @endcode
          */
+#ifndef KDE_NO_DEPRECATED
         static KDE_DEPRECATED AskSaveResult askEmbedOrSave( const KUrl & url, const \
QString& mimeType, const QString & suggestedFileName = QString(), int flags = 0 ); \
+#endif  
         // virtual so that KHTML can implement differently (HTML cache)
         virtual void save( const KUrl & url, const QString & suggestedFileName );
--- trunk/KDE/kdelibs/kparts/mainwindow.cpp #1192881:1192882
@@ -64,12 +64,14 @@
   PartBase::setPartObject( this );
 }
 
+#ifndef KDE_NO_DEPRECATED
 MainWindow::MainWindow( QWidget* parent, const char *name, Qt::WindowFlags f )
   : KXmlGuiWindow( parent, f ),d(new MainWindowPrivate())
 {
   setObjectName( name );
   PartBase::setPartObject( this );
 }
+#endif
 
 MainWindow::~MainWindow()
 {
--- trunk/KDE/kdelibs/kparts/mainwindow.h #1192881:1192882
@@ -52,7 +52,9 @@
    */
   explicit MainWindow( QWidget* parent = 0, Qt::WindowFlags f = \
KDE_DEFAULT_WINDOWFLAGS );  /// @deprecated, remove the name argument and use \
setObjectName instead +#ifndef KDE_NO_DEPRECATED
   KDE_CONSTRUCTOR_DEPRECATED explicit MainWindow( QWidget* parent, const char *name \
= 0, Qt::WindowFlags f = KDE_DEFAULT_WINDOWFLAGS ); +#endif
   /**
    * Destructor.
    */
--- trunk/KDE/kdelibs/kparts/part.cpp #1192881:1192882
@@ -492,19 +492,23 @@
     d->m_file = localFilePath;
 }
 
+#ifndef KDE_NO_DEPRECATED
 bool ReadOnlyPart::isLocalFileTemporary() const
 {
     Q_D(const ReadOnlyPart);
 
     return d->m_bTemp;
 }
+#endif
 
+#ifndef KDE_NO_DEPRECATED
 void ReadOnlyPart::setLocalFileTemporary( bool temp )
 {
     Q_D(ReadOnlyPart);
 
     d->m_bTemp = temp;
 }
+#endif
 
 void ReadOnlyPart::setProgressInfoEnabled( bool show )
 {
--- trunk/KDE/kdelibs/kparts/part.h #1192881:1192882
@@ -683,12 +683,16 @@
     /**
      * @internal
      */
+#ifndef KDE_NO_DEPRECATED
     KDE_DEPRECATED bool isLocalFileTemporary() const;
+#endif
 
     /**
      * @internal
      */
+#ifndef KDE_NO_DEPRECATED
     KDE_DEPRECATED void setLocalFileTemporary( bool temp );
+#endif
 
     /**
      * Sets the url associated with this part.
--- trunk/KDE/kdelibs/kparts/plugin.cpp #1192881:1192882
@@ -28,7 +28,6 @@
 #include <QtCore/QObject>
 #include <QtCore/QFileInfo>
 
-#include <klibloader.h>
 #include <kcomponentdata.h>
 #include <kstandarddirs.h>
 #include <kdebug.h>
@@ -169,6 +168,7 @@
 }
 
 // static, deprecated
+#ifndef KDE_NO_DEPRECATED
 Plugin* Plugin::loadPlugin( QObject * parent, const char* libname )
 {
     Plugin* plugin = KLibLoader::createInstance<Plugin>( libname, parent );
@@ -177,12 +177,15 @@
     plugin->d->m_library = libname;
     return plugin;
 }
+#endif
 
 // static, deprecated
+#ifndef KDE_NO_DEPRECATED
 Plugin* Plugin::loadPlugin( QObject * parent, const QByteArray &libname )
 {
     return loadPlugin( parent, libname.data() );
 }
+#endif
 
 Plugin* Plugin::loadPlugin( QObject * parent, const QString &libname )
 {
@@ -192,7 +195,14 @@
 // static
 Plugin* Plugin::loadPlugin( QObject * parent, const QString &libname, const QString \
&keyword )  {
-    Plugin* plugin = KLibLoader::createInstance<Plugin>( keyword, libname, parent );
+    KPluginLoader loader( libname );
+    KPluginFactory* factory = loader.factory();
+
+    if (!factory) {
+        return 0;
+    }
+
+    Plugin* plugin = factory->create<Plugin>( keyword, parent );
     if ( !plugin )
         return 0;
     plugin->d->m_library = libname;
--- trunk/KDE/kdelibs/kparts/plugin.h #1192881:1192882
@@ -170,13 +170,17 @@
      * @internal
      * @return The plugin created from the library @p libname
      */
+#ifndef KDE_NO_DEPRECATED
     KDE_DEPRECATED static Plugin* loadPlugin( QObject * parent, const char* libname \
); +#endif
 
     /**
      * @internal, added only for source compatibility
      * @return The plugin created from the library @p libname
      */
+#ifndef KDE_NO_DEPRECATED
     KDE_DEPRECATED static Plugin* loadPlugin( QObject * parent, const QByteArray \
&libname ); +#endif
 
     /**
      * @internal


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

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