[kde-doc-english] [kompare/frameworks] /: Remove kdelibs4support.

Jeremy Whiting jpwhiting at kde.org
Sat Oct 18 22:13:38 UTC 2014


Git commit 8e0c64e1614fad94b913ad7c9be4dbe56ccf57b3 by Jeremy Whiting.
Committed on 17/10/2014 at 16:10.
Pushed by whiting into branch 'frameworks'.

Remove kdelibs4support.

Change KUrl to QUrl.
Use QLayout/QFrame instead of KVBox.
Use QFileDialog instead of KFileDialog.
Add utility method for generating QUrl from strings.
REVIEW:120627

M  +6    -1    CMakeLists.txt
M  +1    -1    doc/index.docbook
M  +11   -11   interfaces/kompareinterface.h
M  +10   -11   kompare_shell.cpp
M  +6    -8    kompare_shell.h
M  +1    -1    komparenavtreepart/CMakeLists.txt
M  +6    -7    komparenavtreepart/komparenavtreepart.cpp
M  +3    -0    komparepart/CMakeLists.txt
M  +108  -99   komparepart/kompare_part.cpp
M  +14   -15   komparepart/kompare_part.h
M  +1    -2    komparepart/komparelistview.cpp
M  +3    -3    komparepart/kompareprefdlg.cpp
M  +8    -8    komparepart/komparesaveoptionswidget.cpp
M  +1    -3    komparepart/komparesplitter.cpp
M  +11   -13   kompareurldialog.cpp
M  +3    -3    kompareurldialog.h
M  +3    -2    libdialogpages/CMakeLists.txt
D  +0    -37   libdialogpages/dialogpagesexport.h
M  +46   -55   libdialogpages/diffpage.cpp
M  +6    -5    libdialogpages/diffpage.h
M  +15   -23   libdialogpages/filespage.cpp
M  +4    -3    libdialogpages/filespage.h
M  +0    -1    libdialogpages/filessettings.cpp
M  +1    -1    libdialogpages/filessettings.h
D  +0    -105  libdialogpages/pagebase.cpp
D  +0    -45   libdialogpages/pagebase.h
M  +24   -34   libdialogpages/viewpage.cpp
M  +6    -5    libdialogpages/viewpage.h
M  +3    -3    libdialogpages/viewsettings.cpp
M  +1    -1    libdialogpages/viewsettings.h
M  +73   -57   main.cpp

http://commits.kde.org/kompare/8e0c64e1614fad94b913ad7c9be4dbe56ccf57b3

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38167c2..58ca092 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,10 +13,15 @@ include(KDEInstallDirs)
 include(KDECMakeSettings)
 include(KDECompilerSettings)
 include(ECMInstallIcons)
+include(GenerateExportHeader)
 
 find_package(KF5 REQUIRED COMPONENTS
+    CoreAddons
+    Codecs
     DocTools
-    KDELibs4Support
+    IconThemes
+    JobWidgets
+    Config
     Parts
     TextEditor
     WidgetsAddons
diff --git a/doc/index.docbook b/doc/index.docbook
index 578d12a..1daca2a 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -1,5 +1,5 @@
 <?xml version="1.0" ?>
-<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
    <!ENTITY kappname "&kompare;">
    <!ENTITY version "4.4.0">
    <!ENTITY package "kdesdk">
diff --git a/interfaces/kompareinterface.h b/interfaces/kompareinterface.h
index 53b19d9..07a271d 100644
--- a/interfaces/kompareinterface.h
+++ b/interfaces/kompareinterface.h
@@ -25,7 +25,7 @@
 #include <kdemacros.h>
 
 class KConfig;
-class KUrl;
+class QUrl;
 
 class KompareInterfacePrivate;
 
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Open and parse the diff file at url.
 	 */
-	virtual bool openDiff( const KUrl& diffUrl ) = 0;
+	virtual bool openDiff( const QUrl& diffUrl ) = 0;
 
 	/**
 	 * Open and parse the supplied diff output
@@ -53,7 +53,7 @@ public:
 	/**
 	 * Open and parse the diff3 file at url.
 	 */
-	virtual bool openDiff3( const KUrl& diff3Url ) = 0;
+	virtual bool openDiff3( const QUrl& diff3Url ) = 0;
 
 	/**
 	 * Open and parse the supplied diff3 output
@@ -66,42 +66,42 @@ public:
 	 * they are (directory, file, diff output file) and call the
 	 * appropriate method(s)
 	 */
-	virtual void compare( const KUrl& sourceFile, const KUrl& destinationFile ) = 0;
+	virtual void compare( const QUrl& sourceFile, const QUrl& destinationFile ) = 0;
 
 	/**
 	 * Compare a Source file to a custom Destination string
 	 */
-	virtual void compareFileString( const KUrl & sourceFile, const QString & destination) = 0;
+	virtual void compareFileString( const QUrl & sourceFile, const QString & destination) = 0;
 
 	/**
 	 * Compare a custom Source string to a Destination file
 	 */
-	virtual void compareStringFile( const QString & source, const KUrl & destinationFile) = 0;
+	virtual void compareStringFile( const QString & source, const QUrl & destinationFile) = 0;
 
 	/**
 	 * Compare, with diff, source with destination files
 	 */
-	virtual void compareFiles( const KUrl& sourceFile, const KUrl& destinationFile ) = 0;
+	virtual void compareFiles( const QUrl& sourceFile, const QUrl& destinationFile ) = 0;
 
 	/**
 	 * Compare, with diff, source with destination directories
 	 */
-	virtual void compareDirs ( const KUrl& sourceDir, const KUrl& destinationDir ) = 0;
+	virtual void compareDirs ( const QUrl& sourceDir, const QUrl& destinationDir ) = 0;
 
 	/**
 	 * Compare, with diff3, originalFile with changedFile1 and changedFile2
 	 */
-	virtual void compare3Files( const KUrl& originalFile, const KUrl& changedFile1, const KUrl& changedFile2 ) = 0;
+	virtual void compare3Files( const QUrl& originalFile, const QUrl& changedFile1, const QUrl& changedFile2 ) = 0;
 
 	/**
 	 * This will show the file and the file with the diff applied
 	 */
-	virtual void openFileAndDiff( const KUrl& file, const KUrl& diffFile ) = 0;
+	virtual void openFileAndDiff( const QUrl& file, const QUrl& diffFile ) = 0;
 
 	/**
 	 * This will show the directory and the directory with the diff applied
 	 */
-	virtual void openDirAndDiff ( const KUrl& dir,  const KUrl& diffFile ) = 0;
+	virtual void openDirAndDiff ( const QUrl& dir,  const QUrl& diffFile ) = 0;
 
 	/**
 	 * This will set the encoding to use for all files that are read or for the diffoutput
diff --git a/kompare_shell.cpp b/kompare_shell.cpp
index dcc4551..38cd20c 100644
--- a/kompare_shell.cpp
+++ b/kompare_shell.cpp
@@ -23,21 +23,20 @@
 #include <QFileDialog>
 #include <QMimeDatabase>
 #include <QPushButton>
+#include <QStatusBar>
 
 #include <ktexteditor/document.h>
 #include <ktexteditor/view.h>
 #include <kedittoolbar.h>
-#include <kencodingfiledialog.h>
 #include <kfile.h>
 #include <kshortcutsdialog.h>
-#include <klibloader.h>
-#include <klocale.h>
+#include <klocalizedstring.h>
 #include <kmessagebox.h>
 #include <ksqueezedtextlabel.h>
-#include <kstatusbar.h>
 #include <kstandardaction.h>
 #include <kmimetypetrader.h>
 #include <kservicetypetrader.h>
+#include <ksharedconfig.h>
 #include <ktoggleaction.h>
 #include <kactioncollection.h>
 #include <kconfiggroup.h>
@@ -163,9 +162,9 @@ bool KompareShell::queryClose()
 	return rv;
 }
 
-void KompareShell::openDiff(const KUrl& url)
+void KompareShell::openDiff(const QUrl& url)
 {
-	qCDebug(KOMPARESHELL) << "Url = " << url.prettyUrl() ;
+	qCDebug(KOMPARESHELL) << "Url = " << url.toString( QUrl::RemovePassword );
 	m_diffURL = url;
 	viewPart()->openDiff( url );
 }
@@ -185,7 +184,7 @@ void KompareShell::openStdin()
 
 }
 
-void KompareShell::compare(const KUrl& source,const KUrl& destination )
+void KompareShell::compare(const QUrl& source,const QUrl& destination )
 {
 	m_sourceURL = source;
 	m_destinationURL = destination;
@@ -193,7 +192,7 @@ void KompareShell::compare(const KUrl& source,const KUrl& destination )
 	viewPart()->compare( source, destination );
 }
 
-void KompareShell::blend( const KUrl& url1, const KUrl& diff )
+void KompareShell::blend( const QUrl& url1, const QUrl& diff )
 {
 	m_sourceURL = url1;
 	m_destinationURL = diff;
@@ -325,7 +324,7 @@ void KompareShell::readProperties(const KConfigGroup &config)
 void KompareShell::slotFileOpen()
 {
 	// FIXME: use different filedialog which gets encoding
-	KUrl url = QFileDialog::getOpenFileUrl( this, QString(), QUrl(), QMimeDatabase().mimeTypeForName("text/x-patch").filterString() );
+	QUrl url = QFileDialog::getOpenFileUrl( this, QString(), QUrl(), QMimeDatabase().mimeTypeForName("text/x-patch").filterString() );
 	if( !url.isEmpty() ) {
 		KompareShell* shell = new KompareShell();
 		shell->show();
@@ -458,7 +457,7 @@ void KompareShell::optionsConfigureKeys()
 
 void KompareShell::optionsConfigureToolbars()
 {
-	KConfigGroup group(KGlobal::config(), autoSaveGroup());
+	KConfigGroup group(KSharedConfig::openConfig(), autoSaveGroup());
 	saveMainWindowSettings(group);
 	// use the standard toolbar editor
 	KEditToolBar dlg(factory());
@@ -468,7 +467,7 @@ void KompareShell::optionsConfigureToolbars()
 
 void KompareShell::newToolbarConfig()
 {
-	KConfigGroup group(KGlobal::config(), autoSaveGroup());
+	KConfigGroup group(KSharedConfig::openConfig(), autoSaveGroup());
 	applyMainWindowSettings(group);
 }
 
diff --git a/kompare_shell.h b/kompare_shell.h
index 8549fcd..4d82ff8 100644
--- a/kompare_shell.h
+++ b/kompare_shell.h
@@ -19,8 +19,6 @@
 #ifndef KOMPARESHELL_H
 #define KOMPARESHELL_H
 
-#include <kapplication.h>
-#include <kurl.h>
 #include <kparts/mainwindow.h>
 #include <kompare.h>
 
@@ -75,7 +73,7 @@ public:
 	/**
 	 * Use this method to load whatever file/URL you have
 	 */
-	void openDiff( const KUrl& url );
+	void openDiff( const QUrl& url );
 
 	/**
 	 * Use this method to load the diff from stdin
@@ -85,12 +83,12 @@ public:
 	/**
 	 * Use this method to compare 2 URLs (files or directories)
 	 */
-	void compare( const KUrl& source, const KUrl& destination );
+	void compare( const QUrl& source, const QUrl& destination );
 
 	/**
 	 * Use this method to blend diff into url1 (file or directory)
 	 */
-	void blend( const KUrl& url1, const KUrl& diff );
+	void blend( const QUrl& url1, const QUrl& diff );
 
 public slots:
 	void slotUpdateStatusBar( int modelIndex, int differenceIndex, int modelCount, int differenceCount, int appliedCount );
@@ -132,9 +130,9 @@ private:
 	void setupStatusBar();
 
 private:
-	KUrl                        m_sourceURL;
-	KUrl                        m_destinationURL;
-	KUrl                        m_diffURL;
+	QUrl                        m_sourceURL;
+	QUrl                        m_destinationURL;
+	QUrl                        m_diffURL;
 
 	KParts::ReadWritePart*      m_viewPart;
 	KParts::ReadOnlyPart*         m_navTreePart;
diff --git a/komparenavtreepart/CMakeLists.txt b/komparenavtreepart/CMakeLists.txt
index 53e8e67..798a3d4 100644
--- a/komparenavtreepart/CMakeLists.txt
+++ b/komparenavtreepart/CMakeLists.txt
@@ -13,8 +13,8 @@ add_library(komparenavtreepart MODULE ${komparenavtreepart_PART_SRCS})
 
 target_link_libraries(komparenavtreepart
     Qt5::Widgets
-    KF5::KDELibs4Support
     KF5::Parts
+    KF5::IconThemes
     ${LIBKOMPAREDIFF2_LIBRARIES}
 )
 
diff --git a/komparenavtreepart/komparenavtreepart.cpp b/komparenavtreepart/komparenavtreepart.cpp
index 3faceff..7be64bb 100644
--- a/komparenavtreepart/komparenavtreepart.cpp
+++ b/komparenavtreepart/komparenavtreepart.cpp
@@ -22,11 +22,10 @@
 #include <QTreeWidgetItemIterator>
 
 #include <klocale.h>
-#include <kiconloader.h>
-#include <kmimetype.h>
-#include <k4aboutdata.h>
+#include <kaboutdata.h>
 #include <kcomponentdata.h>
 #include <kpluginfactory.h>
+#include <kiconloader.h>
 
 #include <difference.h>
 #include <diffmodel.h>
@@ -766,11 +765,11 @@ KDirLVI::~KDirLVI()
 	m_modelList.clear();
 }
 
-static K4AboutData aboutData()
+static KAboutData aboutData()
 {
-    K4AboutData about("komparenavtreepart", 0, ki18n("KompareNavTreePart"), "1.2");
-    about.addAuthor(ki18n("John Firebaugh"), ki18n("Author"), "jfirebaugh at kde.org");
-    about.addAuthor(ki18n("Otto Bruggeman"), ki18n("Author"), "bruggie at gmail.com" );
+    KAboutData about("komparenavtreepart", i18n("KompareNavTreePart"), "1.2");
+    about.addAuthor(i18n("John Firebaugh"), i18n("Author"), "jfirebaugh at kde.org");
+    about.addAuthor(i18n("Otto Bruggeman"), i18n("Author"), "bruggie at gmail.com" );
     return about;
 }
 
diff --git a/komparepart/CMakeLists.txt b/komparepart/CMakeLists.txt
index 09b61e6..04045b2 100644
--- a/komparepart/CMakeLists.txt
+++ b/komparepart/CMakeLists.txt
@@ -26,6 +26,9 @@ target_link_libraries(komparepart
     ${LIBKOMPAREDIFF2_LIBRARIES}
     kompareinterface
     KF5::ConfigWidgets
+    KF5::CoreAddons
+    KF5::JobWidgets
+    Qt5::PrintSupport
 )
 
 install(TARGETS komparepart  DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/komparepart/kompare_part.cpp b/komparepart/kompare_part.cpp
index 4d40be0..1521518 100644
--- a/komparepart/kompare_part.cpp
+++ b/komparepart/kompare_part.cpp
@@ -20,31 +20,30 @@
 
 #include "kompare_part.h"
 
+#include <QDialog>
 #include <QLayout>
 #include <QWidget>
 #include <QPainter>
 #include <QPrinter>
 #include <QPrintDialog>
 #include <QPrintPreviewDialog>
+#include <QTemporaryDir>
+#include <QTemporaryFile>
 
-#include <k4aboutdata.h>
-#include <kaction.h>
+#include <kaboutdata.h>
 #include <kactioncollection.h>
-#include <kapplication.h>
 #include <kcomponentdata.h>
-#include <kdeprintdialog.h>
-#include <kdialog.h>
-#include <kfiledialog.h>
-#include <klocale.h>
+#include <kjobwidgets.h>
+#include <klocalizedstring.h>
 #include <kmessagebox.h>
+#include <kpluginfactory.h>
 #include <kstandardaction.h>
-#include <kstandarddirs.h>
 #include <kstandardshortcut.h>
-#include <ktemporaryfile.h>
-#include <ktempdir.h>
 
-#include <kio/netaccess.h>
-#include <kglobal.h>
+#include <kio/copyjob.h>
+#include <kio/statjob.h>
+#include <kio/filecopyjob.h>
+#include <kio/mkdirjob.h>
 
 #include <diffmodel.h>
 #include "komparelistview.h"
@@ -59,7 +58,6 @@
 Q_LOGGING_CATEGORY(KOMPAREPART, "komparepart")
 
 K_PLUGIN_FACTORY( KomparePartFactory, registerPlugin<KomparePart>(); )
-K_EXPORT_PLUGIN( KomparePartFactory )
 
 ViewSettings* KomparePart::m_viewSettings = 0L;
 DiffSettings* KomparePart::m_diffSettings = 0L;
@@ -76,7 +74,7 @@ KomparePart::KomparePart( QWidget *parentWidget, QObject *parent, const QVariant
 		m_diffSettings = new DiffSettings( 0 );
 	}
 
-	readProperties( KGlobal::config().data() );
+	readProperties( KSharedConfig::openConfig().data() );
 
 	m_view = new KompareView ( m_viewSettings, parentWidget );
 	setWidget( m_view );
@@ -208,7 +206,7 @@ void KomparePart::setEncoding( const QString& encoding )
 	m_modelList->setEncoding( encoding );
 }
 
-bool KomparePart::openDiff( const KUrl& url )
+bool KomparePart::openDiff( const QUrl& url )
 {
 	qCDebug(KOMPAREPART) << "Url = " << url.url();
 
@@ -254,7 +252,7 @@ bool KomparePart::openDiff( const QString& diffOutput )
 	return value;
 }
 
-bool KomparePart::openDiff3( const KUrl& diff3Url )
+bool KomparePart::openDiff3( const QUrl& diff3Url )
 {
 	// FIXME: Implement this !!!
 	qCDebug(KOMPAREPART) << "Not implemented yet. Filename is: " << diff3Url;
@@ -275,63 +273,76 @@ bool KomparePart::exists( const QString& url )
 	return fi.exists();
 }
 
-bool KomparePart::fetchURL( const KUrl& url, bool addToSource )
+bool KomparePart::fetchURL( const QUrl& url, bool addToSource )
 {
 	// Default value if there is an error is "", we rely on it!
 	QString tempFileName( "" );
 	// Only in case of error do we set result to false, don't forget!!
 	bool result = true;
-	KTempDir* tmpDir = 0;
+	QTemporaryDir* tmpDir = 0;
 
 	if ( !url.isLocalFile() )
 	{
-		KIO::UDSEntry node;
-		KIO::NetAccess::stat( url, node, widget() );
-		if ( !node.isDir() )
-		{
-			if ( ! KIO::NetAccess::download( url, tempFileName, widget() ) )
-			{
-				slotShowError( i18n( "<qt>The URL <b>%1</b> cannot be downloaded.</qt>", url.toString(QUrl::RemovePassword) ) );
-				tempFileName = ""; // Not sure if download has already touched this tempFileName when there is an error
-				result = false;
-			}
-		}
-		else
-		{
-			tmpDir = new KTempDir(KStandardDirs::locateLocal("tmp", "kompare"));
-			tmpDir->setAutoRemove( true ); // Yes this is the default but just to make sure
-			if ( ! KIO::NetAccess::dircopy( url, KUrl( tmpDir->name() ), widget() ) )
-			{
-				slotShowError( i18n( "<qt>The URL <b>%1</b> cannot be downloaded.</qt>", url.toString(QUrl::RemovePassword) ) );
-				delete tmpDir;
-				tmpDir = 0;
-				result = false;
-			}
-			else
-			{
-				tempFileName = tmpDir->name();
-				qCDebug(KOMPAREPART) << "tempFileName = " << tempFileName;
-				// If a directory is copied into KTempDir then the directory in
-				// here is what I need to add to tempFileName
-				QDir dir( tempFileName );
-				QStringList entries = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot );
-				if ( entries.size() == 1 ) // More than 1 entry in here means big problems!!!
-				{
-					if ( !tempFileName.endsWith( '/' ) )
-						tempFileName += '/';
-					tempFileName += entries.at( 0 );
-					tempFileName += '/';
-				}
-				else
-				{
-					qCDebug(KOMPAREPART) << "Yikes, nothing downloaded?";
-					delete tmpDir;
-					tmpDir = 0;
-					tempFileName = "";
-					result = false;
-				}
-			}
-		}
+        KIO::StatJob *statJob = KIO::stat( url );
+        KJobWidgets::setWindow( statJob, widget() );
+        if (statJob->exec() )
+        {
+            KIO::UDSEntry node;
+            node = statJob->statResult();
+            if ( !node.isDir() )
+            {
+                tmpDir = new QTemporaryDir(QDir::tempPath() + "/kompare");
+                tmpDir->setAutoRemove( true );
+                tempFileName = tmpDir->path() + QLatin1Char('/') + url.fileName();
+                KIO::FileCopyJob* copyJob = KIO::file_copy( url, QUrl::fromLocalFile( tempFileName ) );
+                KJobWidgets::setWindow( copyJob, widget() );
+                if ( ! copyJob->exec() )
+                {
+                    qDebug() << "download error " << copyJob->errorString();
+                    slotShowError( i18n( "<qt>The URL <b>%1</b> cannot be downloaded.</qt>", url.toString(QUrl::RemovePassword) ) );
+                    tempFileName = ""; // Not sure if download has already touched this tempFileName when there is an error
+                    result = false;
+                }
+            }
+            else
+            {
+                tmpDir = new QTemporaryDir(QDir::tempPath() + "/kompare");
+                tmpDir->setAutoRemove( true ); // Yes this is the default but just to make sure
+                KIO::CopyJob *copyJob = KIO::copy( url, QUrl::fromLocalFile( tmpDir->path() ));
+                KJobWidgets::setWindow( copyJob, widget() );
+                if ( ! copyJob->exec() )
+                {
+                    slotShowError( i18n( "<qt>The URL <b>%1</b> cannot be downloaded.</qt>", url.toString(QUrl::RemovePassword) ) );
+                    delete tmpDir;
+                    tmpDir = 0;
+                    result = false;
+                }
+                else
+                {
+                    tempFileName = tmpDir->path();
+                    qCDebug(KOMPAREPART) << "tempFileName = " << tempFileName;
+                    // If a directory is copied into QTemporaryDir then the directory in
+                    // here is what I need to add to tempFileName
+                    QDir dir( tempFileName );
+                    QStringList entries = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot );
+                    if ( entries.size() == 1 ) // More than 1 entry in here means big problems!!!
+                    {
+                        if ( !tempFileName.endsWith( '/' ) )
+                            tempFileName += '/';
+                        tempFileName += entries.at( 0 );
+                        tempFileName += '/';
+                    }
+                    else
+                    {
+                        qCDebug(KOMPAREPART) << "Yikes, nothing downloaded?";
+                        delete tmpDir;
+                        tmpDir = 0;
+                        tempFileName = "";
+                        result = false;
+                    }
+                }
+            }
+        }
 	}
 	else
 	{
@@ -348,12 +359,12 @@ bool KomparePart::fetchURL( const KUrl& url, bool addToSource )
 	if ( addToSource )
 	{
 		m_info.localSource = tempFileName;
-		m_info.sourceKTempDir = tmpDir;
+		m_info.sourceQTempDir = tmpDir;
 	}
 	else
 	{
 		m_info.localDestination = tempFileName;
-		m_info.destinationKTempDir = tmpDir;
+		m_info.destinationQTempDir = tmpDir;
 	}
 
 	return result;
@@ -364,34 +375,30 @@ void KomparePart::cleanUpTemporaryFiles()
 	qCDebug(KOMPAREPART) << "Cleaning temporary files.";
 	if ( !m_info.localSource.isEmpty() )
 	{
-		if ( m_info.sourceKTempDir == 0 )
-			KIO::NetAccess::removeTempFile( m_info.localSource );
-		else
+		if ( m_info.sourceQTempDir != 0 )
 		{
-			delete m_info.sourceKTempDir;
-			m_info.sourceKTempDir = 0;
+			delete m_info.sourceQTempDir;
+			m_info.sourceQTempDir = 0;
 		}
 		m_info.localSource = "";
 	}
 	if ( !m_info.localDestination.isEmpty() )
 	{
-		if ( m_info.destinationKTempDir == 0  )
-			KIO::NetAccess::removeTempFile( m_info.localDestination );
-		else
+		if ( m_info.destinationQTempDir != 0  )
 		{
-			delete m_info.destinationKTempDir;
-			m_info.destinationKTempDir = 0;
+			delete m_info.destinationQTempDir;
+			m_info.destinationQTempDir = 0;
 		}
 		m_info.localDestination = "";
 	}
 }
 
-void KomparePart::compare( const KUrl& source, const KUrl& destination )
+void KomparePart::compare( const QUrl& source, const QUrl& destination )
 {
 	// FIXME: This is silly, i can use NetAccess::stat to figure out what it is and not
 	// wait until i am in the modellist to determine the mode we're supposed to be in.
 	// That should make the code more readable
-	// I should store the KTempDir(s)/File(s) in the Info struct as well and delete it at the right time
+	// I should store the QTemporaryDir(s)/File(s) in the Info struct as well and delete it at the right time
 	m_info.source = source;
 	m_info.destination = destination;
 
@@ -405,7 +412,7 @@ void KomparePart::compare( const KUrl& source, const KUrl& destination )
 	compareAndUpdateAll();
 }
 
-void KomparePart::compareFileString( const KUrl & sourceFile, const QString & destination)
+void KomparePart::compareFileString( const QUrl & sourceFile, const QString & destination)
 {
 	//Set the modeto specify that the source is a file, and the destination is a string
 	m_info.mode = Kompare::ComparingFileString;
@@ -420,7 +427,7 @@ void KomparePart::compareFileString( const KUrl & sourceFile, const QString & de
 	compareAndUpdateAll();
 }
 
-void KomparePart::compareStringFile( const QString & source, const KUrl & destinationFile)
+void KomparePart::compareStringFile( const QString & source, const QUrl & destinationFile)
 {
 	//Set the modeto specify that the source is a file, and the destination is a string
 	m_info.mode = Kompare::ComparingStringFile;
@@ -435,7 +442,7 @@ void KomparePart::compareStringFile( const QString & source, const KUrl & destin
 	compareAndUpdateAll();
 }
 
-void KomparePart::compareFiles( const KUrl& sourceFile, const KUrl& destinationFile )
+void KomparePart::compareFiles( const QUrl& sourceFile, const QUrl& destinationFile )
 {
 	m_info.mode = Kompare::ComparingFiles;
 
@@ -452,7 +459,7 @@ void KomparePart::compareFiles( const KUrl& sourceFile, const KUrl& destinationF
 	compareAndUpdateAll();
 }
 
-void KomparePart::compareDirs( const KUrl& sourceDirectory, const KUrl& destinationDirectory )
+void KomparePart::compareDirs( const QUrl& sourceDirectory, const QUrl& destinationDirectory )
 {
 	m_info.mode = Kompare::ComparingDirs;
 
@@ -467,7 +474,7 @@ void KomparePart::compareDirs( const KUrl& sourceDirectory, const KUrl& destinat
 	compareAndUpdateAll();
 }
 
-void KomparePart::compare3Files( const KUrl& /*originalFile*/, const KUrl& /*changedFile1*/, const KUrl& /*changedFile2*/ )
+void KomparePart::compare3Files( const QUrl& /*originalFile*/, const QUrl& /*changedFile1*/, const QUrl& /*changedFile2*/ )
 {
 	// FIXME: actually implement this some day :)
 	updateActions();
@@ -475,7 +482,7 @@ void KomparePart::compare3Files( const KUrl& /*originalFile*/, const KUrl& /*cha
 	updateStatus();
 }
 
-void KomparePart::openFileAndDiff( const KUrl& file, const KUrl& diffFile )
+void KomparePart::openFileAndDiff( const QUrl& file, const QUrl& diffFile )
 {
 	m_info.source = file;
 	m_info.destination = diffFile;
@@ -489,7 +496,7 @@ void KomparePart::openFileAndDiff( const KUrl& file, const KUrl& diffFile )
 	compareAndUpdateAll();
 }
 
-void KomparePart::openDirAndDiff ( const KUrl& dir,  const KUrl& diffFile )
+void KomparePart::openDirAndDiff ( const QUrl& dir,  const QUrl& diffFile )
 {
 	m_info.source = dir;
 	m_info.destination = diffFile;
@@ -529,17 +536,18 @@ bool KomparePart::saveAll()
 
 void KomparePart::saveDiff()
 {
-	KDialog dlg( widget() );
+	QDialog dlg( widget() );
 	dlg.setObjectName( "save_options" );
 	dlg.setModal( true );
 	dlg.setWindowTitle( i18n("Diff Options") );
-	dlg.setButtons( KDialog::Ok|KDialog::Cancel );
+	QDialogButtonBox *buttons = new QDialogButtonBox( QDialogButtonBox::Save | QDialogButtonBox::Cancel, &dlg );
 	KompareSaveOptionsWidget* w = new KompareSaveOptionsWidget(
 	                                             m_info.localSource,
 	                                             m_info.localDestination,
 	                                             m_diffSettings, &dlg );
-	dlg.setMainWidget( w );
-	dlg.setButtonGuiItem( KDialog::Ok, KStandardGuiItem::save() );
+	QHBoxLayout *layout = new QHBoxLayout(&dlg);
+	layout->addWidget( w );
+	dlg.setLayout( layout );
 
 	if( dlg.exec() ) {
 		w->saveOptions();
@@ -549,9 +557,10 @@ void KomparePart::saveDiff()
 
 		while ( 1 )
 		{
-			KUrl url = KFileDialog::getSaveUrl( m_info.destination.url(),
-			              i18n("*.diff *.dif *.patch|Patch Files"), widget(), i18n( "Save .diff" ) );
-			if ( KIO::NetAccess::exists( url, KIO::NetAccess::DestinationSide, widget() ) )
+			QUrl url = QFileDialog::getSaveFileUrl( widget(), i18n( "Save .diff" ),
+                                                    m_info.destination.url(),
+                                                    i18n("Patch Files (*.diff *.dif *.patch)") );
+			if ( QFile::exists( url.toLocalFile() ) )
 			{
 				int result = KMessageBox::warningYesNoCancel( widget(), i18n("The file exists or is write-protected; do you want to overwrite it?"), i18n("File Exists"), KGuiItem(i18n("Overwrite")), KGuiItem(i18n("Do Not Overwrite")) );
 				if ( result == KMessageBox::Cancel )
@@ -589,7 +598,7 @@ void KomparePart::slotFilePrint()
 {
 	QPrinter printer;
 	printer.setOrientation( QPrinter::Landscape );
-	QPrintDialog* dlg = KdePrint::createPrintDialog( &printer, m_splitter );
+	QPrintDialog* dlg = new QPrintDialog( &printer, 0 );
 
 	if ( dlg->exec() == QDialog::Accepted )
 	{
@@ -631,12 +640,12 @@ void KomparePart::slotPaintRequested( QPrinter* printer )
 	qCDebug(KOMPAREPART) << "Done painting something...";
 }
 
-K4AboutData* KomparePart::createAboutData()
+KAboutData* KomparePart::createAboutData()
 {
-    K4AboutData *about = new K4AboutData("kompare", 0, ki18n("KomparePart"), "4.0");
-    about->addAuthor(ki18n("John Firebaugh"), ki18n("Author"), "jfirebaugh at kde.org");
-    about->addAuthor(ki18n("Otto Bruggeman"), ki18n("Author"), "bruggie at gmail.com" );
-    about->addAuthor(ki18n("Kevin Kofler"), ki18n("Author"), "kevin.kofler at chello.at" );
+    KAboutData *about = new KAboutData("kompare", i18n("KomparePart"), "4.0");
+    about->addAuthor(i18n("John Firebaugh"), i18n("Author"), "jfirebaugh at kde.org");
+    about->addAuthor(i18n("Otto Bruggeman"), i18n("Author"), "bruggie at gmail.com" );
+    about->addAuthor(i18n("Kevin Kofler"), i18n("Author"), "kevin.kofler at chello.at" );
     return about;
 }
 
diff --git a/komparepart/kompare_part.h b/komparepart/kompare_part.h
index 24475f1..52bcc0b 100644
--- a/komparepart/kompare_part.h
+++ b/komparepart/kompare_part.h
@@ -20,7 +20,6 @@
 #ifndef KOMPAREPART_H
 #define KOMPAREPART_H
 
-#include <kparts/factory.h>
 #include <kparts/readwritepart.h>
 #include <QVariantList>
 #include <QLoggingCategory>
@@ -34,7 +33,7 @@ class QWidget;
 
 class KTemporaryFile;
 class KUrl;
-class K4AboutData;
+class KAboutData;
 
 namespace Diff2 {
 class Difference;
@@ -87,47 +86,47 @@ public:
 	// Do we really want to expose this ???
 	const Diff2::KompareModelList* model() const { return m_modelList; };
 
-	static K4AboutData *createAboutData();
+	static KAboutData *createAboutData();
 
 public:
 	// Reimplemented from the KompareInterface
 	/**
 	 * Open and parse the diff file at diffUrl.
 	 */
-	virtual bool openDiff( const KUrl& diffUrl );
+	virtual bool openDiff( const QUrl& diffUrl );
 
 	/** Added on request of Harald Fernengel */
 	virtual bool openDiff( const QString& diffOutput );
 
 	/** Open and parse the diff3 file at diff3Url */
-	virtual bool openDiff3( const KUrl& diff3URL );
+	virtual bool openDiff3( const QUrl& diff3URL );
 
 	/** Open and parse the file diff3Output with the output of diff3 */
 	virtual bool openDiff3( const QString& diff3Output );
 
 	/** Compare, with diff, source with destination */
-	virtual void compare( const KUrl& sourceFile, const KUrl& destinationFile );
+	virtual void compare( const QUrl& sourceFile, const QUrl& destinationFile );
 
 	/** Compare a Source file to a custom Destination string */
-	virtual void compareFileString( const KUrl & sourceFile, const QString & destination);
+	virtual void compareFileString( const QUrl & sourceFile, const QString & destination);
 
 	/** Compare a custom Source string to a Destination file */
-	virtual void compareStringFile( const QString & source, const KUrl & destinationFile);
+	virtual void compareStringFile( const QString & source, const QUrl & destinationFile);
 
 	/** Compare, with diff, source with destination */
-	virtual void compareFiles( const KUrl& sourceFile, const KUrl& destinationFile );
+	virtual void compareFiles( const QUrl& sourceFile, const QUrl& destinationFile );
 
 	/** Compare, with diff, source with destination */
-	virtual void compareDirs ( const KUrl& sourceDir, const KUrl& destinationDir );
+	virtual void compareDirs ( const QUrl& sourceDir, const QUrl& destinationDir );
 
 	/** Compare, with diff3, originalFile with changedFile1 and changedFile2 */
-	virtual void compare3Files( const KUrl& originalFile, const KUrl& changedFile1, const KUrl& changedFile2 );
+	virtual void compare3Files( const QUrl& originalFile, const QUrl& changedFile1, const QUrl& changedFile2 );
 
 	/** This will show the file and the file with the diff applied */
-	virtual void openFileAndDiff( const KUrl& file, const KUrl& diffFile );
+	virtual void openFileAndDiff( const QUrl& file, const QUrl& diffFile );
 
 	/** This will show the directory and the directory with the diff applied */
-	virtual void openDirAndDiff ( const KUrl& dir,  const KUrl& diffFile );
+	virtual void openDirAndDiff ( const QUrl& dir,  const QUrl& diffFile );
 
 	/** Reimplementing this because this one knows more about the real part then the interface */
 	virtual void setEncoding( const QString& encoding );
@@ -211,10 +210,10 @@ private:
 	void cleanUpTemporaryFiles();
 	void setupActions();
 	bool exists( const QString& url );
-	bool isDirectory( const KUrl& url );
+	bool isDirectory( const QUrl& url );
 	// FIXME (like in cpp file not urgent) Replace with enum, cant find a proper
 	// name now but it is private anyway so can not be used from outside
-	bool fetchURL( const KUrl& url, bool isSource );
+	bool fetchURL( const QUrl& url, bool isSource );
 
 private:
 	// Uhm why were these static again ???
diff --git a/komparepart/komparelistview.cpp b/komparepart/komparelistview.cpp
index 35bbab8..bd4be1a 100644
--- a/komparepart/komparelistview.cpp
+++ b/komparepart/komparelistview.cpp
@@ -29,8 +29,7 @@
 #include <QWheelEvent>
 #include <QScrollBar>
 
-#include <kglobal.h>
-#include <kglobalsettings.h>
+#include <ksharedconfig.h>
 
 #include <diffmodel.h>
 #include <diffhunk.h>
diff --git a/komparepart/kompareprefdlg.cpp b/komparepart/kompareprefdlg.cpp
index 1184856..da5ad5d 100644
--- a/komparepart/kompareprefdlg.cpp
+++ b/komparepart/kompareprefdlg.cpp
@@ -18,9 +18,9 @@
 
 #include "kompareprefdlg.h"
 
-#include <kiconloader.h>
-#include <klocale.h>
-#include <ktabwidget.h>
+#include <QTabWidget>
+
+#include <klocalizedstring.h>
 #include <khelpclient.h>
 
 #include "diffpage.h"
diff --git a/komparepart/komparesaveoptionswidget.cpp b/komparepart/komparesaveoptionswidget.cpp
index 4c9acba..79ac309 100644
--- a/komparepart/komparesaveoptionswidget.cpp
+++ b/komparepart/komparesaveoptionswidget.cpp
@@ -23,7 +23,7 @@
 #include <QRadioButton>
 #include <QSpinBox>
 
-#include <kfiledialog.h>
+#include <kio/global.h>
 #include <kurlrequester.h>
 
 #include <diffsettings.h>
@@ -42,20 +42,20 @@ KompareSaveOptionsWidget::KompareSaveOptionsWidget( QString source, QString dest
 	m_directoryRequester->setMode(
 	    KFile::ExistingOnly | KFile::Directory | KFile::LocalOnly );
 
-	KUrl sourceURL;
-	KUrl destinationURL;
+	QUrl sourceURL;
+	QUrl destinationURL;
 	sourceURL.setPath( source );
 	destinationURL.setPath( destination );
 
 	// Find a common root.
-	KUrl root( sourceURL );
-	while( root.isValid() && !root.isParentOf( destinationURL ) && root != root.upUrl() ) {
-		root = root.upUrl();
+	QUrl root( sourceURL );
+	while( root.isValid() && !root.isParentOf( destinationURL ) && root != KIO::upUrl(root) ) {
+		root = KIO::upUrl(root);
 	}
 
 	// If we found a common root, change to that directory and
 	// strip the common part from source and destination.
-	if( root.isValid() && root != root.upUrl() ) {
+	if( root.isValid() && root != KIO::upUrl(root) ) {
 		m_directoryRequester->setUrl( root.url() );
 	}
 
@@ -95,7 +95,7 @@ KompareSaveOptionsWidget::~KompareSaveOptionsWidget()
 
 QString KompareSaveOptionsWidget::directory() const
 {
-	return KUrl( m_directoryRequester->url() ).toLocalFile();
+	return QUrl( m_directoryRequester->url() ).toLocalFile();
 }
 
 void KompareSaveOptionsWidget::updateCommandLine()
diff --git a/komparepart/komparesplitter.cpp b/komparepart/komparesplitter.cpp
index 8d496bf..0c98606 100644
--- a/komparepart/komparesplitter.cpp
+++ b/komparepart/komparesplitter.cpp
@@ -36,8 +36,6 @@
 #include <QWheelEvent>
 
 // kde
-#include <kapplication.h>
-#include <kglobalsettings.h>
 
 // kompare
 #include "komparelistview.h"
@@ -95,7 +93,7 @@ KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget *parent ) :
 
 	// we need to receive childEvents now so that d->list is ready for when
 	// slotSetSelection(...) arrives
-	kapp->sendPostedEvents(this, QEvent::ChildAdded);
+	qApp->sendPostedEvents(this, QEvent::ChildAdded);
 
 	// init stuff
 	slotUpdateScrollBars();
diff --git a/kompareurldialog.cpp b/kompareurldialog.cpp
index 7de050b..eff7887 100644
--- a/kompareurldialog.cpp
+++ b/kompareurldialog.cpp
@@ -20,11 +20,9 @@
 
 #include <QGroupBox>
 
-#include <kapplication.h>
-#include <kdialog.h>
-#include <kglobal.h>
-#include <klocale.h>
+#include <klocalizedstring.h>
 #include <kmessagebox.h>
+#include <ksharedconfig.h>
 #include <kurlcombobox.h>
 #include <kurlrequester.h>
 
@@ -37,11 +35,11 @@
 
 Q_DECLARE_LOGGING_CATEGORY(KOMPARESHELL)
 
-KompareURLDialog::KompareURLDialog( QWidget *parent, Qt::WFlags flags )
+KompareURLDialog::KompareURLDialog( QWidget *parent, Qt::WindowFlags flags )
         : KPageDialog( parent, flags )
 {
 	setFaceType( List );
-	KSharedConfig::Ptr cfg = KGlobal::config();
+	KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
 
 	m_filesPage = new FilesPage();
 	KPageWidgetItem *filesItem = addPage( m_filesPage, i18n( "Files" ) );
@@ -90,7 +88,7 @@ void KompareURLDialog::showEvent ( QShowEvent * event )
 
 void KompareURLDialog::slotButtonClicked( int button )
 {
-	if ( button == KDialog::Cancel )
+	if ( button == QDialogButtonBox::Cancel )
 	{
 		reject();
 		return;
@@ -112,7 +110,7 @@ void KompareURLDialog::slotButtonClicked( int button )
 
 	m_filesPage->setURLsInComboBoxes();
 
-	KSharedConfig::Ptr cfg = KGlobal::config();
+	KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
 
 	m_filesPage->apply();
 	m_diffPage->apply();
@@ -137,18 +135,18 @@ void KompareURLDialog::slotEnableOk()
  * Returns the first URL, which was entered.
  * @return first URL
  */
-KUrl KompareURLDialog::getFirstURL() const
+QUrl KompareURLDialog::getFirstURL() const
 {
-	return KUrl( m_filesPage->firstURLRequester()->url() );
+	return m_filesPage->firstURLRequester()->url();
 }
 
 /**
  * Returns the second URL, which was entered.
  * @return second URL
  */
-KUrl KompareURLDialog::getSecondURL() const
+QUrl KompareURLDialog::getSecondURL() const
 {
-	return KUrl( m_filesPage->secondURLRequester()->url() );
+	return m_filesPage->secondURLRequester()->url();
 }
 
 /**
@@ -173,7 +171,7 @@ void KompareURLDialog::setSecondGroupBoxTitle( const QString& title )
 void KompareURLDialog::setGroup( const QString& groupName )
 {
 	m_filesSettings->setGroup( groupName );
-	m_filesSettings->loadSettings( KGlobal::config().data() );
+	m_filesSettings->loadSettings( KSharedConfig::openConfig().data() );
 	m_filesPage->setSettings( m_filesSettings );
 }
 
diff --git a/kompareurldialog.h b/kompareurldialog.h
index dc50c58..875a645 100644
--- a/kompareurldialog.h
+++ b/kompareurldialog.h
@@ -40,11 +40,11 @@ class KompareURLDialog : public KPageDialog
 	Q_OBJECT
 
 public:
-	explicit KompareURLDialog( QWidget *parent= 0, Qt::WFlags flags= 0 );
+	explicit KompareURLDialog( QWidget *parent= 0, Qt::WindowFlags flags= 0 );
 	~KompareURLDialog();
 
-	KUrl getFirstURL() const;
-	KUrl getSecondURL() const;
+	QUrl getFirstURL() const;
+	QUrl getSecondURL() const;
 	QString encoding() const;
 
 	void setFirstGroupBoxTitle ( const QString& title );
diff --git a/libdialogpages/CMakeLists.txt b/libdialogpages/CMakeLists.txt
index 769a115..6fa73ee 100644
--- a/libdialogpages/CMakeLists.txt
+++ b/libdialogpages/CMakeLists.txt
@@ -4,7 +4,6 @@
 set(dialogpages_PART_SRCS
 	filessettings.cpp
 	viewsettings.cpp
-	pagebase.cpp
 	diffpage.cpp
 	filespage.cpp
 	viewpage.cpp )
@@ -14,8 +13,10 @@ add_library(komparedialogpages SHARED ${dialogpages_PART_SRCS})
 
 include_directories(${LIBKOMPAREDIFF2_INCLUDE_DIR})
 
+generate_export_header(komparedialogpages BASE_NAME DIALOGPAGES)
+
 target_link_libraries(komparedialogpages
-    KF5::KDELibs4Support
+    KF5::Codecs
     KF5::Parts
     KF5::WidgetsAddons
     ${LIBKOMPAREDIFF2_LIBRARIES}
diff --git a/libdialogpages/dialogpagesexport.h b/libdialogpages/dialogpagesexport.h
deleted file mode 100644
index b2de57f..0000000
--- a/libdialogpages/dialogpagesexport.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- *   Copyright 2007 Andreas Pakulat <apaku at gmx.de>                         *
- *   Copyright 2006 Matt Rogers <mattr at kde.org>                            *
- *   Copyright 2004 Jarosław Staniek <staniek at kde.org>                         *
- *                                                                         *
- *   This program 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 program 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 General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU Library General Public     *
- *   License along with this program; if not, write to the                 *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef LIBDIALOGPAGESEXPORT_H
-#define LIBDIALOGPAGESEXPORT_H
-
-/* needed for KDE_EXPORT macros */
-#include <kdemacros.h>
-
-#ifndef DIALOGPAGES_EXPORT
-# ifdef MAKE_KOMPAREDIALOGPAGES_LIB
-#  define DIALOGPAGES_EXPORT KDE_EXPORT
-# else
-#  define DIALOGPAGES_EXPORT KDE_IMPORT
-# endif
-#endif
-
-#endif
-
diff --git a/libdialogpages/diffpage.cpp b/libdialogpages/diffpage.cpp
index 7800b48..18ef7b4 100644
--- a/libdialogpages/diffpage.cpp
+++ b/libdialogpages/diffpage.cpp
@@ -25,31 +25,39 @@
 #include <QSpinBox>
 #include <QVBoxLayout>
 #include <QHBoxLayout>
+#include <QTabWidget>
 #include <QToolTip>
 #include <QButtonGroup>
 
-#include <kbuttongroup.h>
-#include <kapplication.h>
 #include <kcombobox.h>
-#include <kdialog.h>
 #include <keditlistwidget.h>
-#include <klibloader.h>
 #include <klineedit.h>
-#include <klocale.h>
-#include <kurl.h>
+#include <klocalizedstring.h>
+#include <ksharedconfig.h>
 #include <kurlcombobox.h>
 #include <kurlrequester.h>
 #include <kservicetypetrader.h>
-#include <ktabwidget.h>
 
 #include <kregexpeditorinterface.h>
-#include <kglobal.h>
 
 #include <diffsettings.h>
 
-DiffPage::DiffPage() : PageBase(), m_ignoreRegExpDialog( 0 )
+QUrl urlFromArg(const QString& arg)
 {
-	m_tabWidget = new KTabWidget( this );
+#if QT_VERSION >= 0x050400
+    return QUrl::fromUserInput(arg, QDir::currentPath(), QUrl::AssumeLocalFile);
+#else
+    // Logic from QUrl::fromUserInput(QString, QString, UserInputResolutionOptions)
+    return (QUrl(arg, QUrl::TolerantMode).isRelative() && !QDir::isAbsolutePath(arg))
+           ? QUrl::fromLocalFile(QDir::current().absoluteFilePath(arg))
+           : QUrl::fromUserInput(arg);
+#endif
+}
+
+DiffPage::DiffPage() : QFrame(), m_ignoreRegExpDialog( 0 )
+{
+	QVBoxLayout *layout = new QVBoxLayout( this );
+	m_tabWidget = new QTabWidget( this );
 
 	addDiffTab();
 
@@ -58,6 +66,7 @@ DiffPage::DiffPage() : PageBase(), m_ignoreRegExpDialog( 0 )
 	addOptionsTab();
 
 	addExcludeTab();
+	layout->addWidget( m_tabWidget );
 }
 
 DiffPage::~DiffPage()
@@ -96,7 +105,7 @@ void DiffPage::setSettings( DiffSettings* setts )
 	m_excludeFileNameGroupBox->setChecked( m_settings->m_excludeFilesFile );
 	slotExcludeFileToggled           ( m_settings->m_excludeFilesFile );
 	m_excludeFileURLComboBox->setUrls( m_settings->m_excludeFilesFileHistoryList );
-	m_excludeFileURLComboBox->setUrl ( KUrl( m_settings->m_excludeFilesFileURL ) );
+	m_excludeFileURLComboBox->setUrl ( urlFromArg( m_settings->m_excludeFilesFileURL ) );
 }
 
 DiffSettings* DiffPage::settings( void )
@@ -138,12 +147,12 @@ void DiffPage::apply()
 	m_settings->m_excludeFilesFileURL            = m_excludeFileURLComboBox->currentText();
 	m_settings->m_excludeFilesFileHistoryList    = m_excludeFileURLComboBox->urls();
 
-	m_settings->saveSettings( KGlobal::config().data() );
+	m_settings->saveSettings( KSharedConfig::openConfig().data() );
 }
 
 void DiffPage::setDefaults()
 {
-	m_diffURLRequester->setUrl( KUrl( "diff" ) );
+	m_diffURLRequester->setUrl( QUrl( "diff" ) );
 	m_newFilesCheckBox->setChecked( true );
 	m_smallerCheckBox->setChecked( true );
 	m_largerCheckBox->setChecked( true );
@@ -159,7 +168,7 @@ void DiffPage::setDefaults()
 
 	m_locSpinBox->setValue( 3 );
 
-        m_modeButtonGroup->button( Kompare::Unified )->setChecked( true );
+	m_modeButtonGroup->button( Kompare::Unified )->setChecked( true );
 
 	m_excludeFilePatternGroupBox->setChecked( false );
 
@@ -198,15 +207,12 @@ void DiffPage::addDiffTab()
 {
 	QWidget* page   = new QWidget( this );
 	QVBoxLayout* layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
 
 	// add diff program selector
 	m_diffProgramGroup = new QGroupBox( page );
 	layout->addWidget( m_diffProgramGroup );
 	QVBoxLayout* bgLayout = new QVBoxLayout( m_diffProgramGroup );
 	m_diffProgramGroup->setTitle( i18n( "Diff Program" ) );
-	//m_diffProgramGroup->setMargin( KDialog::marginHint() );
 
 	m_diffURLRequester = new KUrlRequester( m_diffProgramGroup);
 	m_diffURLRequester->setObjectName("diffURLRequester" );
@@ -214,7 +220,6 @@ void DiffPage::addDiffTab()
 	bgLayout->addWidget( m_diffURLRequester );
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
 
 	m_tabWidget->addTab( page, i18n( "Diff" ) );
 }
@@ -223,39 +228,35 @@ void DiffPage::addFormatTab()
 {
 	QWidget* page   = new QWidget( this );
 	QVBoxLayout* layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
 
 	// add diff modes
 	m_modeButtonGroup = new QButtonGroup( page );
-        QGroupBox *box = new QGroupBox( page );
+	QGroupBox *box = new QGroupBox( page );
 	box->setWhatsThis( i18n( "Select the format of the output generated by diff. Unified is the one that is used most frequently because it is very readable. The KDE developers like this format the best so use it for sending patches." ) );
 	layout->addWidget( box );
 	QVBoxLayout* bgLayout = new QVBoxLayout( box );
 	box->setTitle( i18n( "Output Format" ) );
-	//m_modeButtonGroup->setMargin( KDialog::marginHint() );
 
-        QRadioButton *radioButton = new QRadioButton( i18n( "Context" ), box );
-        m_modeButtonGroup->addButton( radioButton, Kompare::Context);
+	QRadioButton *radioButton = new QRadioButton( i18n( "Context" ), box );
+	m_modeButtonGroup->addButton( radioButton, Kompare::Context);
+	bgLayout->addWidget( radioButton );
+	radioButton = new QRadioButton( i18n( "Normal" ),  box );
+	m_modeButtonGroup->addButton( radioButton, Kompare::Normal);
+	bgLayout->addWidget( radioButton );
+	radioButton =  new QRadioButton( i18n( "Unified" ), box );
+	m_modeButtonGroup->addButton( radioButton, Kompare::Unified);
 	bgLayout->addWidget( radioButton );
-        radioButton = new QRadioButton( i18n( "Normal" ),  box );
-        m_modeButtonGroup->addButton( radioButton, Kompare::Normal);
-        bgLayout->addWidget( radioButton );
-        radioButton =  new QRadioButton( i18n( "Unified" ), box );
-        m_modeButtonGroup->addButton( radioButton, Kompare::Unified);
-        bgLayout->addWidget( radioButton );
 
 	// #lines of context (loc)
 	QGroupBox* groupBox = new QGroupBox( page );
-        QHBoxLayout *groupLayout = new QHBoxLayout;
-        groupBox->setLayout( groupLayout );
+	QHBoxLayout *groupLayout = new QHBoxLayout;
+	groupBox->setLayout( groupLayout );
 	layout->addWidget( groupBox );
 	groupBox->setTitle( i18n( "Lines of Context" ) );
 	groupBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
-	//groupBox->setMargin( KDialog::marginHint() );
 
 	QLabel* label = new QLabel( i18n( "Number of context lines:" ));
-        groupLayout->addWidget( label );
+	groupLayout->addWidget( label );
 	label->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
 	m_locSpinBox = new QSpinBox( groupBox );
 	m_locSpinBox->setRange( 0, 100 );
@@ -264,7 +265,6 @@ void DiffPage::addFormatTab()
 	label->setBuddy( m_locSpinBox );
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
 
 	m_tabWidget->addTab( page, i18n( "Format" ) );
 }
@@ -273,15 +273,12 @@ void DiffPage::addOptionsTab()
 {
 	QWidget* page   = new QWidget( this );
 	QVBoxLayout* layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
 
 	// add diff options
-	KButtonGroup* optionButtonGroup = new KButtonGroup( page );
+	QGroupBox* optionButtonGroup = new QGroupBox( page );
 	layout->addWidget( optionButtonGroup );
 	QVBoxLayout* bgLayout = new QVBoxLayout( optionButtonGroup );
 	optionButtonGroup->setTitle( i18n( "General" ) );
-	//optionButtonGroup->setMargin( KDialog::marginHint() );
 
 	m_newFilesCheckBox    = new QCheckBox( i18n( "&Treat new files as empty" ), optionButtonGroup );
 	m_newFilesCheckBox->setToolTip( i18n( "This option corresponds to the -N diff option." ) );
@@ -305,7 +302,6 @@ void DiffPage::addOptionsTab()
 	layout->addLayout( groupLayout );
 	groupLayout->setObjectName( "regexp_horizontal_layout" );
 	groupLayout->setSpacing( -1 );
-	groupLayout->setMargin( KDialog::marginHint() );
 
 	m_ignoreRegExpCheckBox = new QCheckBox( i18n( "Ignore regexp:" ), page );
 	m_ignoreRegExpCheckBox->setToolTip( i18n( "This option corresponds to the -I diff option." ) );
@@ -326,11 +322,10 @@ void DiffPage::addOptionsTab()
 		connect( ignoreRegExpEditButton, SIGNAL( clicked() ), this, SLOT( slotShowRegExpEditor() ) );
 	}
 
-	KButtonGroup* moreOptionButtonGroup = new KButtonGroup( page );
+	QGroupBox* moreOptionButtonGroup = new QGroupBox( page );
 	layout->addWidget( moreOptionButtonGroup );
 	bgLayout = new QVBoxLayout( moreOptionButtonGroup );
 	moreOptionButtonGroup->setTitle( i18n( "Whitespace" ) );
-	//moreOptionButtonGroup->setMargin( KDialog::marginHint() );
 
 	m_tabsCheckBox        = new QCheckBox( i18n( "E&xpand tabs to spaces in output" ), moreOptionButtonGroup );
 	m_tabsCheckBox->setToolTip( i18n( "This option corresponds to the -t diff option." ) );
@@ -354,7 +349,6 @@ void DiffPage::addOptionsTab()
 	bgLayout->addWidget( m_ignoreTabExpansionCheckBox );
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
 
 	m_tabWidget->addTab( page, i18n( "Options" ) );
 }
@@ -363,17 +357,15 @@ void DiffPage::addExcludeTab()
 {
 	QWidget* page = new QWidget( this );
 	QVBoxLayout* layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
 
 	m_excludeFilePatternGroupBox = new QGroupBox( page );
-        m_excludeFilePatternGroupBox->setCheckable(true);
-        QHBoxLayout *excludeFileLayout = new QHBoxLayout;
-        m_excludeFilePatternGroupBox->setLayout( excludeFileLayout );
+	m_excludeFilePatternGroupBox->setCheckable(true);
+	QHBoxLayout *excludeFileLayout = new QHBoxLayout;
+	m_excludeFilePatternGroupBox->setLayout( excludeFileLayout );
 	m_excludeFilePatternGroupBox->setTitle( i18n( "File Pattern to Exclude" ) );
 	m_excludeFilePatternGroupBox->setToolTip( i18n( "If this is checked you can enter a shell pattern in the text box on the right or select entries from the list." ) );
 	m_excludeFilePatternEditListBox = new KEditListWidget;
-        excludeFileLayout->addWidget( m_excludeFilePatternEditListBox );
+	excludeFileLayout->addWidget( m_excludeFilePatternEditListBox );
 	m_excludeFilePatternEditListBox->setObjectName( "exclude_file_pattern_editlistbox" );
 	m_excludeFilePatternEditListBox->setButtons( KEditListWidget::Add|KEditListWidget::Remove );
 	m_excludeFilePatternEditListBox->setCheckAtEntering( false );
@@ -384,17 +376,17 @@ void DiffPage::addExcludeTab()
 	connect( m_excludeFilePatternGroupBox, SIGNAL(toggled(bool)), this, SLOT(slotExcludeFilePatternToggled(bool)));
 
 	m_excludeFileNameGroupBox = new QGroupBox( page );
-        m_excludeFileNameGroupBox->setCheckable( true );
-        excludeFileLayout = new QHBoxLayout;
-        m_excludeFileNameGroupBox->setLayout( excludeFileLayout );
+	m_excludeFileNameGroupBox->setCheckable( true );
+	excludeFileLayout = new QHBoxLayout;
+	m_excludeFileNameGroupBox->setLayout( excludeFileLayout );
 	m_excludeFileNameGroupBox->setTitle( i18n( "File with Filenames to Exclude" ) );
 	m_excludeFileNameGroupBox->setToolTip( i18n( "If this is checked you can enter a filename in the combo box below." ) );
 	m_excludeFileURLComboBox  = new KUrlComboBox( KUrlComboBox::Files, true );
-        excludeFileLayout->addWidget( m_excludeFileURLComboBox );
+	excludeFileLayout->addWidget( m_excludeFileURLComboBox );
 	m_excludeFileURLComboBox->setObjectName( "exclude_file_urlcombo" );
 	m_excludeFileURLComboBox->setToolTip( i18n( "Here you can enter the URL of a file with shell patterns to ignore during the comparison of the folders." ) );
 	m_excludeFileURLRequester = new KUrlRequester( m_excludeFileURLComboBox,m_excludeFileNameGroupBox );
-        excludeFileLayout->addWidget( m_excludeFileURLRequester );
+	excludeFileLayout->addWidget( m_excludeFileURLRequester );
 	m_excludeFileURLRequester->setObjectName("exclude_file_name_urlrequester" );
 	m_excludeFileURLRequester->setToolTip( i18n( "Any file you select in the dialog that pops up when you click it will be put in the dialog to the left of this button." ) );
 	layout->addWidget( m_excludeFileNameGroupBox );
@@ -402,7 +394,6 @@ void DiffPage::addExcludeTab()
 	connect( m_excludeFileNameGroupBox, SIGNAL(toggled(bool)), this, SLOT(slotExcludeFileToggled(bool)));
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
 
 	m_tabWidget->addTab( page, i18n( "Exclude" ) );
 }
diff --git a/libdialogpages/diffpage.h b/libdialogpages/diffpage.h
index 37490b1..353dd41 100644
--- a/libdialogpages/diffpage.h
+++ b/libdialogpages/diffpage.h
@@ -19,8 +19,9 @@
 #ifndef DIFFPAGE_H
 #define DIFFPAGE_H
 
-#include "pagebase.h"
-#include "dialogpagesexport.h"
+#include <QFrame>
+
+#include "dialogpages_export.h"
 
 class QCheckBox;
 class QDialog;
@@ -28,16 +29,16 @@ class QSpinBox;
 class QStringList;
 class QButtonGroup;
 class QGroupBox;
+class QTabWidget;
 
 class KLineEdit;
 class KEditListWidget;
-class KTabWidget;
 class KUrlComboBox;
 class KUrlRequester;
 
 class DiffSettings;
 
-class DIALOGPAGES_EXPORT DiffPage : public PageBase
+class DIALOGPAGES_EXPORT DiffPage : public QFrame
 {
 Q_OBJECT
 public:
@@ -97,7 +98,7 @@ public:
 	QButtonGroup*  m_modeButtonGroup;
 	QGroupBox*     m_diffProgramGroup;
 
-	KTabWidget*    m_tabWidget;
+	QTabWidget*    m_tabWidget;
 };
 
 #endif
diff --git a/libdialogpages/filespage.cpp b/libdialogpages/filespage.cpp
index 6a87fe3..5e5febf 100644
--- a/libdialogpages/filespage.cpp
+++ b/libdialogpages/filespage.cpp
@@ -22,26 +22,21 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 
-#include <kapplication.h>
 #include <kcharsets.h>
 #include <kconfig.h>
-#include <kdialog.h>
-#include <klocale.h>
-#include <kglobal.h>
-#include <kurl.h>
+#include <klocalizedstring.h>
 #include <kurlcombobox.h>
 #include <kurlrequester.h>
 
 #include "filessettings.h"
 
-FilesPage::FilesPage() : PageBase()
+QUrl urlFromArg(const QString &arg);
+
+FilesPage::FilesPage() : QFrame()
 {
-	QWidget* page = new QWidget( this );
-	QVBoxLayout* layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
+	QVBoxLayout* layout = new QVBoxLayout( this );
 
-	m_firstGB = new QGroupBox( "You have to set this moron :)", page );
+	m_firstGB = new QGroupBox( "You have to set this moron :)", this );
 	layout->addWidget( m_firstGB );
 	QHBoxLayout* gb1Layout = new QHBoxLayout( m_firstGB );
 	m_firstURLComboBox = new KUrlComboBox( KUrlComboBox::Both, true, m_firstGB );
@@ -50,7 +45,7 @@ FilesPage::FilesPage() : PageBase()
 	gb1Layout->addWidget( m_firstURLRequester );
 	m_firstURLRequester->setFocus();
 
-	m_secondGB = new QGroupBox( "This too moron !", page );
+	m_secondGB = new QGroupBox( "This too moron !", this );
 	layout->addWidget( m_secondGB );
 	QHBoxLayout* gb2Layout = new QHBoxLayout( m_secondGB );
 	m_secondURLComboBox = new KUrlComboBox( KUrlComboBox::Both, true, m_secondGB );
@@ -58,13 +53,13 @@ FilesPage::FilesPage() : PageBase()
 	m_secondURLRequester = new KUrlRequester( m_secondURLComboBox, m_secondGB );
 	gb2Layout->addWidget( m_secondURLRequester );
 
-	m_thirdGB = new QGroupBox( i18n( "Encoding" ), page );
+	m_thirdGB = new QGroupBox( i18n( "Encoding" ), this );
 	layout->addWidget( m_thirdGB );
 	QHBoxLayout* gb3Layout = new QHBoxLayout( m_thirdGB );
 	m_encodingComboBox = new KComboBox( false, m_thirdGB );
 	m_encodingComboBox->setObjectName( "encoding_combobox" );
 	m_encodingComboBox->insertItem( 0, "Default" );
-	m_encodingComboBox->insertItems( 1, KGlobal::charsets()->availableEncodingNames() );
+	m_encodingComboBox->insertItems( 1, KCharsets::charsets()->availableEncodingNames() );
 	gb3Layout->addWidget( m_encodingComboBox );
 
 	layout->addWidget( m_firstGB );
@@ -72,9 +67,6 @@ FilesPage::FilesPage() : PageBase()
 	layout->addWidget( m_thirdGB );
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
-
-	//addTab( page, i18n( "&Files" ) );
 }
 
 FilesPage::~FilesPage()
@@ -111,8 +103,8 @@ void FilesPage::setURLsInComboBoxes()
 {
 //	qDebug() << "first : " << m_firstURLComboBox->currentText() ;
 //	qDebug() << "second: " << m_secondURLComboBox->currentText() ;
-	m_firstURLComboBox->setUrl( KUrl( m_firstURLComboBox->currentText() ) );
-	m_secondURLComboBox->setUrl( KUrl( m_secondURLComboBox->currentText() ) );
+	m_firstURLComboBox->setUrl( urlFromArg( m_firstURLComboBox->currentText() ) );
+	m_secondURLComboBox->setUrl( urlFromArg( m_secondURLComboBox->currentText() ) );
 }
 
 
@@ -131,9 +123,9 @@ void FilesPage::setSettings( FilesSettings* settings )
 	m_settings = settings;
 
 	m_firstURLComboBox->setUrls( m_settings->m_recentSources );
-	m_firstURLComboBox->setUrl( KUrl( m_settings->m_lastChosenSourceURL ) );
+	m_firstURLComboBox->setUrl( urlFromArg( m_settings->m_lastChosenSourceURL ) );
 	m_secondURLComboBox->setUrls( m_settings->m_recentDestinations );
-	m_secondURLComboBox->setUrl( KUrl( m_settings->m_lastChosenDestinationURL ) );
+	m_secondURLComboBox->setUrl( urlFromArg( m_settings->m_lastChosenDestinationURL ) );
 	m_encodingComboBox->setCurrentIndex( m_encodingComboBox->findText( m_settings->m_encoding, Qt::MatchFixedString ) );
 }
 
@@ -154,9 +146,9 @@ void FilesPage::apply()
 void FilesPage::setDefaults()
 {
 	m_firstURLComboBox->setUrls( QStringList() );
-	m_firstURLComboBox->setUrl( KUrl( "" ) );
+	m_firstURLComboBox->setUrl( QUrl() );
 	m_secondURLComboBox->setUrls( QStringList() );
-	m_secondURLComboBox->setUrl( KUrl( "" ) );
+	m_secondURLComboBox->setUrl( QUrl() );
 	m_encodingComboBox->setCurrentIndex( 0 ); // "Default"
 }
 
diff --git a/libdialogpages/filespage.h b/libdialogpages/filespage.h
index 42afafc..305b4b9 100644
--- a/libdialogpages/filespage.h
+++ b/libdialogpages/filespage.h
@@ -19,8 +19,9 @@
 #ifndef FILESPAGE_H
 #define FILESPAGE_H
 
-#include "pagebase.h"
-#include "dialogpagesexport.h"
+#include <QFrame>
+
+#include "dialogpages_export.h"
 
 class QGroupBox;
 
@@ -30,7 +31,7 @@ class KUrlRequester;
 
 class FilesSettings;
 
-class DIALOGPAGES_EXPORT FilesPage : public PageBase
+class DIALOGPAGES_EXPORT FilesPage : public QFrame
 {
 Q_OBJECT
 public:
diff --git a/libdialogpages/filessettings.cpp b/libdialogpages/filessettings.cpp
index 0e19dc0..3fef343 100644
--- a/libdialogpages/filessettings.cpp
+++ b/libdialogpages/filessettings.cpp
@@ -17,7 +17,6 @@
 
 #include "filessettings.h"
 
-#include <kapplication.h>
 #include <kconfig.h>
 #include <kconfiggroup.h>
 
diff --git a/libdialogpages/filessettings.h b/libdialogpages/filessettings.h
index dc3306e..ba4481c 100644
--- a/libdialogpages/filessettings.h
+++ b/libdialogpages/filessettings.h
@@ -22,7 +22,7 @@
 
 #include <settingsbase.h>
 
-#include "dialogpagesexport.h"
+#include "dialogpages_export.h"
 
 class KConfig;
 
diff --git a/libdialogpages/pagebase.cpp b/libdialogpages/pagebase.cpp
deleted file mode 100644
index ba1574a..0000000
--- a/libdialogpages/pagebase.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************
-                                prefsbase.cpp
-                                -------------
-        begin                   : Sun Mar 4 2001
-        Copyright 2001 Otto Bruggeman <otto.bruggeman at home.nl>
-        Copyright 2001 John Firebaugh <jfirebaugh at kde.org>
-        Copyright 2007 Kevin Kofler   <kevin.kofler at chello.at>
-****************************************************************************/
-
-/***************************************************************************
-**
-**   This program is free software; you can redistribute it and/or modify
-**   it under the terms of the GNU General Public License as published by
-**   the Free Software Foundation; either version 2 of the License, or
-**   (at your option) any later version.
-**
-***************************************************************************/
-
-#include "pagebase.h"
-
-#include <QtCore/QObject>
-#include <QLayout>
-
-PageBase::PageBase() : KVBox()
-{
-
-}
-
-PageBase::~PageBase()
-{
-
-}
-
-/** No descriptions */
-QSize PageBase::sizeHintForWidget( QWidget* widget )
-{
-	//
-	// The size is computed by adding the sizeHint().height() of all
-	// widget children and taking the width of the widest child and adding
-	// layout()->margin() and layout()->spacing()
-	//
-
-	// this code in this method has been ripped out of a file in kbabel
-	// so copyright goes to the kbabel authors.
-
-	QSize size;
-
-	int numChild = 0;
-	QList<QObject*> l = widget->children();
-
-
-
-	for( int i=0; i < l.count(); i++ )
-	{
-		QObject *o = l.at(i);
-		if( o->isWidgetType() )
-		{
-			numChild += 1;
-			QWidget *w=((QWidget*)o);
-
-			QSize s = w->sizeHint();
-			if( s.isEmpty() == true )
-			{
-				s = QSize( 50, 100 ); // Default size
-			}
-			size.setHeight( size.height() + s.height() );
-			if( s.width() > size.width() )
-			{
-				size.setWidth( s.width() );
-			}
-		}
-	}
-
-	if( numChild > 0 )
-	{
-		size.setHeight( size.height() + widget->layout()->spacing()*(numChild-1) );
-		size += QSize( widget->layout()->margin()*2, widget->layout()->margin()*2 + 1 );
-	}
-	else
-	{
-		size = QSize( 1, 1 );
-	}
-
-	return( size );
-}
-
-/** No descriptions */
-void PageBase::apply()
-{
-
-}
-
-/** No descriptions */
-void PageBase::restore()
-{
-
-}
-
-/** No descriptions */
-void PageBase::setDefaults()
-{
-
-}
-
-#include "pagebase.moc"
diff --git a/libdialogpages/pagebase.h b/libdialogpages/pagebase.h
deleted file mode 100644
index 0cef46f..0000000
--- a/libdialogpages/pagebase.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/***************************************************************************
-                                prefsbase.h
-                                -----------
-        begin                   : Sun Mar 4 2001
-        Copyright 2001 Otto Bruggeman <otto.bruggeman at home.nl>
-        Copyright 2001 John Firebaugh <jfirebaugh at kde.org>
-        Copyright 2007 Kevin Kofler   <kevin.kofler at chello.at>
-****************************************************************************/
-
-/***************************************************************************
-**
-**   This program is free software; you can redistribute it and/or modify
-**   it under the terms of the GNU General Public License as published by
-**   the Free Software Foundation; either version 2 of the License, or
-**   (at your option) any later version.
-**
-***************************************************************************/
-
-#ifndef PAGEBASE_H
-#define PAGEBASE_H
-
-#include <QtCore/QSize>
-
-#include <kvbox.h>
-#include <kompare.h>
-
-class PageBase : public KVBox
-{
-Q_OBJECT
-public:
-	PageBase();
-	~PageBase();
-
-public:
-	/** No descriptions */
-	QSize        sizeHintForWidget( QWidget* widget );
-	/** No descriptions */
-	virtual void restore();
-	/** No descriptions */
-	virtual void apply();
-	/** No descriptions */
-	virtual void setDefaults();
-};
-
-#endif
diff --git a/libdialogpages/viewpage.cpp b/libdialogpages/viewpage.cpp
index 07bdba5..d49ef6e 100644
--- a/libdialogpages/viewpage.cpp
+++ b/libdialogpages/viewpage.cpp
@@ -26,17 +26,14 @@
 #include <QVBoxLayout>
 #include <QGridLayout>
 #include <QFontComboBox>
+#include <QTabWidget>
 
-#include <kapplication.h>
 #include <kcolorbutton.h>
-#include <kdialog.h>
 #include <klocale.h>
-#include <kglobal.h>
-#include <ktabwidget.h>
 
 #include "viewsettings.h"
 
-ViewPage::ViewPage() : PageBase()
+ViewPage::ViewPage() : QFrame()
 {
 	QWidget*     page;
 	QVBoxLayout* layout;
@@ -46,17 +43,17 @@ ViewPage::ViewPage() : PageBase()
 	QGroupBox*   tabGroupBox;
 	QLabel*      label;
 
-	m_tabWidget = new KTabWidget( this );
+	m_tabWidget = new QTabWidget( this );
+	layout = new QVBoxLayout( this );
+	layout->addWidget( m_tabWidget );
+
 	page   = new QWidget( m_tabWidget );
 	layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
 
 	// add a groupbox
 	colorGroupBox = new QGroupBox( page );
 	colorGroupBox->setTitle( i18n( "Colors" ) );
 	layout->addWidget( colorGroupBox );
-	//colorGroupBox->setMargin( KDialog::marginHint() );
 	gridLayout = new QGridLayout( colorGroupBox );
 
 	// add the removeColor
@@ -89,68 +86,61 @@ ViewPage::ViewPage() : PageBase()
 
 	// scroll number of lines (snol)
 	snolGroupBox = new QGroupBox( page );
-        QHBoxLayout *snolLayout = new QHBoxLayout;
-        snolGroupBox->setLayout( snolLayout );
+	QHBoxLayout *snolLayout = new QHBoxLayout;
+	snolGroupBox->setLayout( snolLayout );
 	snolGroupBox->setTitle( i18n( "Mouse Wheel" ) );
 	layout->addWidget( snolGroupBox );
-	//snolGroupBox->setMargin( KDialog::marginHint() );
 
-	label            = new QLabel( i18n( "Number of lines:" ) );
-        snolLayout->addWidget( label );
+	label = new QLabel( i18n( "Number of lines:" ) );
+	snolLayout->addWidget( label );
 	m_snolSpinBox    = new QSpinBox( snolGroupBox );
 	m_snolSpinBox->setRange( 0, 50 );
-        snolLayout->addWidget( m_snolSpinBox );
+	snolLayout->addWidget( m_snolSpinBox );
 	label->setBuddy( m_snolSpinBox );
 
 	// Temporarily here for testing...
 	// number of spaces for a tab character stuff
 	tabGroupBox = new QGroupBox( page );
-        QHBoxLayout *tabLayout = new QHBoxLayout;
-        tabGroupBox->setLayout( tabLayout );
+	QHBoxLayout *tabLayout = new QHBoxLayout;
+	tabGroupBox->setLayout( tabLayout );
 	tabGroupBox->setTitle( i18n( "Tabs to Spaces" ) );
 	layout->addWidget( tabGroupBox );
-	//tabGroupBox->setMargin( KDialog::marginHint() );
 
 	label = new QLabel( i18n( "Number of spaces to convert a tab character to:" ) );
-        tabLayout->addWidget( label );
+	tabLayout->addWidget( label );
 	m_tabSpinBox = new QSpinBox( tabGroupBox );
 	m_tabSpinBox->setRange( 1, 16 );
-        tabLayout->addWidget( m_tabSpinBox );
+	tabLayout->addWidget( m_tabSpinBox );
 	label->setBuddy( m_tabSpinBox );
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
 
 	m_tabWidget->addTab( page, i18n( "Appearance" ) );
 
 	page   = new QWidget( m_tabWidget );
 	layout = new QVBoxLayout( page );
-	layout->setSpacing( KDialog::spacingHint() );
-	layout->setMargin( KDialog::marginHint() );
 
 	QGroupBox* gb = new QGroupBox( page );
-        QHBoxLayout *layfont = new QHBoxLayout;
-        gb->setLayout( layfont );
+	QHBoxLayout *layfont = new QHBoxLayout;
+	gb->setLayout( layfont );
 	gb->setTitle( i18n( "Text Font" ) );
 	layout->addWidget( gb );
-	//gb->setMargin( KDialog::marginHint() );
 
 	label = new QLabel( i18n( "Font:" ) );
 	m_fontCombo = new QFontComboBox;
-        layfont->addWidget( label );
-        layfont->addWidget( m_fontCombo );
+	layfont->addWidget( label );
+	layfont->addWidget( m_fontCombo );
 	m_fontCombo->setObjectName( "fontcombo" );
 	label->setBuddy( m_fontCombo );
 
 	label = new QLabel( i18n( "Size:" ) );
-        layfont->addWidget( label );
+	layfont->addWidget( label );
 	m_fontSizeSpinBox = new QSpinBox( gb );
 	m_fontSizeSpinBox->setRange( 6, 24 );
-        layfont->addWidget( m_fontSizeSpinBox );
+	layfont->addWidget( m_fontSizeSpinBox );
 	label->setBuddy( m_fontSizeSpinBox );
 
 	layout->addStretch( 1 );
-	page->setMinimumSize( sizeHintForWidget( page ) );
 
 	m_tabWidget->addTab( page, i18n( "Fonts" ) );
 }
@@ -196,7 +186,7 @@ void ViewPage::apply()
 	m_settings->m_font                = QFont( m_fontCombo->currentFont() );
 	m_settings->m_font.setPointSize( m_fontSizeSpinBox->value() );
 
-	m_settings->saveSettings( KGlobal::config().data() );
+	m_settings->saveSettings( KSharedConfig::openConfig().data() );
 }
 
 void ViewPage::setDefaults()
@@ -206,11 +196,11 @@ void ViewPage::setDefaults()
 	m_removedColorButton->setColor( ViewSettings::default_removeColor );
 	m_appliedColorButton->setColor( ViewSettings::default_appliedColor );
 	m_snolSpinBox->setValue       ( 3 );
-        m_tabSpinBox->setValue        ( 4 );
+	m_tabSpinBox->setValue        ( 4 );
 
 	// TODO: port
 	// m_fontCombo->setCurrentFont   ( KGlobalSettings::fixedFont().family() );
-        m_fontSizeSpinBox->setValue   ( 10 );
+	m_fontSizeSpinBox->setValue   ( 10 );
 }
 
 #include "viewpage.moc"
diff --git a/libdialogpages/viewpage.h b/libdialogpages/viewpage.h
index b5b770d..5dd53a0 100644
--- a/libdialogpages/viewpage.h
+++ b/libdialogpages/viewpage.h
@@ -19,18 +19,19 @@
 #ifndef VIEWPAGE_H
 #define VIEWPAGE_H
 
-#include "pagebase.h"
-#include "dialogpagesexport.h"
+#include <QFrame>
+
+#include "dialogpages_export.h"
 
 class QFontComboBox;
 class QSpinBox;
+class QTabWidget;
 
 class KColorButton;
-class KTabWidget;
 
 class ViewSettings;
 
-class DIALOGPAGES_EXPORT ViewPage : public PageBase
+class DIALOGPAGES_EXPORT ViewPage : public QFrame
 {
 Q_OBJECT
 public:
@@ -59,7 +60,7 @@ public:
 	QSpinBox*     m_tabSpinBox;
 	QFontComboBox*   m_fontCombo;
 	QSpinBox*     m_fontSizeSpinBox;
-	KTabWidget*   m_tabWidget;
+	QTabWidget*   m_tabWidget;
 };
 
 #endif
diff --git a/libdialogpages/viewsettings.cpp b/libdialogpages/viewsettings.cpp
index 5a69d0b..00fe31e 100644
--- a/libdialogpages/viewsettings.cpp
+++ b/libdialogpages/viewsettings.cpp
@@ -18,10 +18,10 @@
 
 #include "viewsettings.h"
 
-#include <QtGui/QFont>
+#include <QFont>
+#include <QFontDatabase>
 
 #include <kconfig.h>
-#include <kglobalsettings.h>
 #include <kconfiggroup.h>
 
 using namespace Diff2;
@@ -56,7 +56,7 @@ void ViewSettings::loadSettings( KConfig* config )
 	m_scrollNoOfLines     = cfg.readEntry  ( "ScrollNoOfLines",     3 );
 	m_tabToNumberOfSpaces = cfg.readEntry  ( "TabToNumberOfSpaces", 4 );
 
-	QFont stdFixed = KGlobalSettings::fixedFont();
+	QFont stdFixed = QFontDatabase::systemFont(QFontDatabase::FixedFont);
 	stdFixed.setPointSize( 10 );
 	m_font                = cfg.readEntry ( "TextFont", stdFixed );
 }
diff --git a/libdialogpages/viewsettings.h b/libdialogpages/viewsettings.h
index dbf6afe..2ea3d16 100644
--- a/libdialogpages/viewsettings.h
+++ b/libdialogpages/viewsettings.h
@@ -24,7 +24,7 @@
 #include <difference.h>
 #include <settingsbase.h>
 
-#include "dialogpagesexport.h"
+#include "dialogpages_export.h"
 
 class DIALOGPAGES_EXPORT ViewSettings : public SettingsBase
 {
diff --git a/main.cpp b/main.cpp
index 4132c84..c89cedd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -24,15 +24,16 @@
  * @author Kevin Kofler   <kevin.kofler at chello.at>
  */
 
-#include <k4aboutdata.h>
-#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+
 #include <kfile.h>
 #include <klocale.h>
 #include <kmessagebox.h>
-#include <kdialog.h>
 
+#include <QApplication>
 #include <QPushButton>
 #include <QDebug>
+#include <QCommandLineParser>
 
 #include "kompare_part.h"
 #include "kompare_shell.h"
@@ -49,6 +50,18 @@ static const char description[] =
  */
 static const char version[] = "4.1.3";
 
+QUrl urlFromArg(const QString& arg)
+{
+#if QT_VERSION >= 0x050400
+    return QUrl::fromUserInput(arg, QDir::currentPath(), QUrl::AssumeLocalFile);
+#else
+    // Logic from QUrl::fromUserInput(QString, QString, UserInputResolutionOptions)
+    return (QUrl(arg, QUrl::TolerantMode).isRelative() && !QDir::isAbsolutePath(arg))
+           ? QUrl::fromLocalFile(QDir::current().absoluteFilePath(arg))
+           : QUrl::fromUserInput(arg);
+#endif
+}
+
 /**
  * Setting up the KAboutData structure.
  * Parsing and handling of the given command line arguments.
@@ -58,61 +71,64 @@ static const char version[] = "4.1.3";
  */
 int main(int argc, char *argv[])
 {
-	K4AboutData aboutData( "kompare", 0, ki18n("Kompare"), version, ki18n(description),
-	                      K4AboutData::License_GPL,
-	                      ki18n("(c) 2001-2004 John Firebaugh, (c) 2001-2005,2009 Otto Bruggeman, (c) 2004-2005 Jeff Snyder, (c) 2007-2012 Kevin Kofler") );
-	aboutData.addAuthor( ki18n("John Firebaugh"), ki18n("Author"), "jfirebaugh at kde.org" );
-	aboutData.addAuthor( ki18n("Otto Bruggeman"), ki18n("Author"), "bruggie at gmail.com" );
-	aboutData.addAuthor( ki18n("Jeff Snyder"), ki18n("Developer"), "jeff at caffeinated.me.uk" );
-	aboutData.addCredit( ki18n("Kevin Kofler"), ki18n("Maintainer"), "kevin.kofler at chello.at" );
-	aboutData.addCredit( ki18n("Chris Luetchford"), ki18n("Kompare icon artist"), "chris at os11.com" );
-	aboutData.addCredit( ki18n("Malte Starostik"), ki18n("A lot of good advice"), "malte at kde.org" );
-	aboutData.addCredit( ki18n("Bernd Gehrmann"), ki18n("Cervisia diff viewer"), "bernd at physik.hu-berlin.de" );
-
-	KCmdLineArgs::init(argc, argv, &aboutData);
-
-	KCmdLineOptions options;
-	options.add("c", ki18n( "This will compare URL1 with URL2" ));
-	options.add("o", ki18n( "This will open URL1 and expect it to be diff output. URL1 can also be a '-' and then it will read from standard input. Can be used for instance for cvs diff | kompare -o -. Kompare will do a check to see if it can find the original file(s) and then blend the original file(s) into the diffoutput and show that in the viewer. -n disables the check." ));
-	options.add("b", ki18n( "This will blend URL2 into URL1, URL2 is expected to be diff output and URL1 the file or folder that the diffoutput needs to be blended into. " ));
-	options.add("n", ki18n( "Disables the check for automatically finding the original file(s) when using '-' as URL with the -o option." ));
-	options.add("e <encoding>", ki18n( "Use this to specify the encoding when calling it from the command line. It will default to the local encoding if not specified." ));
-	options.add("+[URL1 [URL2]]");
-	options.add("+-");
-	KCmdLineArgs::addCmdLineOptions( options );
-	KApplication kompare;
+	KAboutData aboutData( "kompare",  i18n("Kompare"), version, i18n(description),
+	                      KAboutLicense::GPL,
+	                      i18n("(c) 2001-2004 John Firebaugh, (c) 2001-2005,2009 Otto Bruggeman, (c) 2004-2005 Jeff Snyder, (c) 2007-2012 Kevin Kofler") );
+	aboutData.addAuthor( i18n("John Firebaugh"), i18n("Author"), "jfirebaugh at kde.org" );
+	aboutData.addAuthor( i18n("Otto Bruggeman"), i18n("Author"), "bruggie at gmail.com" );
+	aboutData.addAuthor( i18n("Jeff Snyder"), i18n("Developer"), "jeff at caffeinated.me.uk" );
+	aboutData.addCredit( i18n("Kevin Kofler"), i18n("Maintainer"), "kevin.kofler at chello.at" );
+	aboutData.addCredit( i18n("Chris Luetchford"), i18n("Kompare icon artist"), "chris at os11.com" );
+	aboutData.addCredit( i18n("Malte Starostik"), i18n("A lot of good advice"), "malte at kde.org" );
+	aboutData.addCredit( i18n("Bernd Gehrmann"), i18n("Cervisia diff viewer"), "bernd at physik.hu-berlin.de" );
+
+	QApplication app(argc, argv);
+	QCommandLineParser parser;
+	KAboutData::setApplicationData(aboutData);
+	parser.addVersionOption();
+	parser.addHelpOption();
+	aboutData.setupCommandLine(&parser);
+
+	parser.addOption(QCommandLineOption("c", i18n("This will compare URL1 with URL2")));
+	parser.addOption(QCommandLineOption("o", i18n( "This will open URL1 and expect it to be diff output. URL1 can also be a '-' and then it will read from standard input. Can be used for instance for cvs diff | kompare -o -. Kompare will do a check to see if it can find the original file(s) and then blend the original file(s) into the diffoutput and show that in the viewer. -n disables the check." )));
+	parser.addOption(QCommandLineOption("b", i18n( "This will blend URL2 into URL1, URL2 is expected to be diff output and URL1 the file or folder that the diffoutput needs to be blended into. " )));
+	parser.addOption(QCommandLineOption("n", i18n( "Disables the check for automatically finding the original file(s) when using '-' as URL with the -o option." )));
+	parser.addOption(QCommandLineOption("e <encoding>", i18n( "Use this to specify the encoding when calling it from the command line. It will default to the local encoding if not specified." )));
+	parser.process(app);
+	aboutData.processCommandLine(&parser);
 	bool difault = false;
 
 	KompareShell* ks;
 
+	QStringList args = parser.positionalArguments();
+
 	// see if we are starting with session management
-	if (kompare.isSessionRestored())
+	if (app.isSessionRestored())
 	{
 		RESTORE(KompareShell)
 	}
 	else
 	{
-		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 
 		ks = new KompareShell();
 		ks->setObjectName( "FirstKompareShell" );
 
-		qCDebug(KOMPARESHELL) << "Arg Count = " << args->count() ;
-		for ( int i=0; i < args->count(); i++ )
+		qCDebug(KOMPARESHELL) << "Arg Count = " << args.count() ;
+		for ( int i=0; i < args.count(); i++ )
 		{
-			qCDebug(KOMPARESHELL) << "Argument " << (i+1) << ": " << args->arg( i ) ;
+			qCDebug(KOMPARESHELL) << "Argument " << (i+1) << ": " << args.at( i ) ;
 		}
 
-		if ( args->isSet( "e" ) )
+		if ( parser.isSet( "e" ) )
 		{
 			// Encoding given...
 			// FIXME: Need to implement this...
 		}
 
-		if ( args->isSet( "o" ) )
+		if ( parser.isSet( "o" ) )
 		{
 			qCDebug(KOMPARESHELL) << "Option -o is set" ;
-			if ( args->count() != 1 )
+			if ( args.count() != 1 )
 			{
 				difault = true;
 			}
@@ -120,78 +136,78 @@ int main(int argc, char *argv[])
 			{
 				ks->show();
 				qCDebug(KOMPARESHELL) << "OpenDiff..." ;
-				if ( args->arg(0) == QLatin1String("-") )
+				if ( args.at(0) == QLatin1String("-") )
 					ks->openStdin();
 				else
-					ks->openDiff( args->url( 0 ) );
+					ks->openDiff( urlFromArg( args.at( 0 ) ) );
 				difault = false;
 			}
 		}
-		else if ( args->isSet( "c" ) )
+		else if ( parser.isSet( "c" ) )
 		{
 			qCDebug(KOMPARESHELL) << "Option -c is set" ;
-			if ( args->count() != 2 )
+			if ( args.count() != 2 )
 			{
-				KCmdLineArgs::usage( "kompare" );
+				parser.showHelp();
 				difault = true;
 			}
 			else
 			{
 				ks->show();
-				KUrl url0 = args->url( 0 );
+				QUrl url0 = urlFromArg(args.at( 0 ));
 				qCDebug(KOMPARESHELL) << "URL0 = " << url0.url() ;
-				KUrl url1 = args->url( 1 );
+				QUrl url1 = urlFromArg(args.at( 1 ));
 				qCDebug(KOMPARESHELL) << "URL1 = " << url1.url() ;
 				ks->compare( url0, url1 );
 				difault = false;
 			}
 		}
-		else if ( args->isSet( "b" ) )
+		else if ( parser.isSet( "b" ) )
 		{
 			qCDebug(KOMPARESHELL) << "Option -b is set" ;
-			if ( args->count() != 2 )
+			if ( args.count() != 2 )
 			{
-				KCmdLineArgs::usage( "kompare" );
+				parser.showHelp();
 				difault = true;
 			}
 			else
 			{
 				ks->show();
 				qCDebug(KOMPARESHELL) << "blend..." ;
-				KUrl url0 = args->url( 0 );
+				QUrl url0 = urlFromArg(args.at( 0 ));
 				qCDebug(KOMPARESHELL) << "URL0 = " << url0.url() ;
-				KUrl url1 = args->url( 1 );
+				QUrl url1 = urlFromArg(args.at( 1 ));
 				qCDebug(KOMPARESHELL) << "URL1 = " << url1.url() ;
 				ks->blend( url0, url1 );
 				difault = false;
 			}
 		}
-		else if ( args->count() == 1 )
+		else if ( args.count() == 1 )
 		{
 			ks->show();
 
 			qCDebug(KOMPARESHELL) << "Single file. so openDiff/openStdin is only possible..." ;
-			if ( args->arg(0) == QLatin1String("-") )
+			if ( args.at(0) == QLatin1String("-") )
 				ks->openStdin();
 			else
-				ks->openDiff( args->url( 0 ) );
+				ks->openDiff( urlFromArg(args.at( 0 ) ) );
 
 			difault = false;
 		}
-		else if ( args->count() == 2 )
+		else if ( args.count() == 2 )
 		{
 			// In this case we are assuming you want to compare files/dirs
 			// and not blending because that is almost impossible to detect
 			ks->show();
 			qCDebug(KOMPARESHELL) << "Dunno, we'll have to figure it out later, trying compare for now..." ;
-			KUrl url0 = args->url( 0 );
+			QUrl url0 = urlFromArg(args.at( 0 ));
 			qCDebug(KOMPARESHELL) << "URL0 = " << url0.url() ;
-			KUrl url1 = args->url( 1 );
+			QUrl url1 = urlFromArg(args.at( 1 ));
 			qCDebug(KOMPARESHELL) << "URL1 = " << url1.url() ;
 			ks->compare( url0, url1 );
 			difault = false;
 		}
-		else if ( args->count() == 0 ) // no options and no args
+		else if ( args.count() == 0 ) // no options and no args
 		{
 			difault = true;
 		}
@@ -221,15 +237,15 @@ int main(int argc, char *argv[])
 				ks->compare( dialog.getFirstURL(), dialog.getSecondURL() );
 			}
 			else
-                        {
+			{
 				return -1;
-                        }
+			}
 		}
 
-		args->clear();
+
 	}
 
-	return kompare.exec();
+	return app.exec();
 }
 
 /* vim: set ts=4 sw=4 noet: */


More information about the kde-doc-english mailing list