Commit 13fd9cfe authored by Michael Reeves's avatar Michael Reeves

*port away from KStandardDirs, KDialog

*use QFontDatabase::systemFont universally
 rm one #ifdef and hard coded fonts.
parent bc6bebc4
......@@ -150,7 +150,8 @@ KDiff3App::KDiff3App( QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff
m_pOptions = &m_pOptionDialog->m_options;
m_pOptionDialog->readOptions( KSharedConfig::openConfig() );
//TODO: Port to KF5/qt5
// Option handling: Only when pParent==0 (no parent)
KCmdLineArgs *args = isPart() ? 0 : KCmdLineArgs::parsedArgs();
......
......@@ -15,10 +15,10 @@
* *
***************************************************************************/
#include <QStandardPaths>
#include <QApplication>
#include <KAboutData>
#include <KLocalizedString>
#include <klocale.h>
#include "kdiff3_shell.h"
#include <kstandarddirs.h>
#include "version.h"
......@@ -43,7 +43,7 @@
#include "common.h"
void initialiseCmdLineArgs( QCommandLineParser& parser ) {
QString configFileName = KStandardDirs().findResource( "config", "kdiff3rc" );
QString configFileName = QStandardPaths::locate(QStandardPaths::GenericConfigLocation , "kdiff3rc" );
QFile configFile( configFileName );
QString ignorableOptionsLine = "-u;-query;-html;-abort";
if( configFile.open( QIODevice::ReadOnly ) ) {
......
......@@ -34,6 +34,7 @@
#include <QPixmap>
#include <QFrame>
#include <QVBoxLayout>
#include <QFontDatabase>
#include <kapplication.h>
#include <kcolorbutton.h>
......@@ -45,7 +46,6 @@
#include <kmainwindow.h> //For ktoolbar.h
#include <ktoolbar.h>
#include <KHelpClient>
//#include <kkeydialog.h>
#include <map>
#include "optiondialog.h"
......@@ -641,25 +641,22 @@ void OptionDialog::setupOtherOptions() {
}
void OptionDialog::setupFontPage( void ) {
QFrame* page = new QFrame();
KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n( "Font" ) );
QFrame* page = new QFrame();
KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n( "Font" ) );
QFont defaultFont;
pageItem->setHeader( i18n( "Editor & Diff Output Font" ) );
pageItem->setIcon( QIcon::fromTheme( QStringLiteral( "preferences-desktop-font" ) ) );
addPage( pageItem );
QVBoxLayout *topLayout = new QVBoxLayout( page );
topLayout->setMargin( 5 );
topLayout->setSpacing( KDialog::spacingHint() );
QFont defaultFont =
#ifdef _WIN32
QFont( "Courier New", 10 );
#elif defined( KREPLACEMENTS_H )
QFont( "Courier", 10 );
#else
KGlobalSettings::fixedFont();
#endif
//TODO use qt5 equivalent layoutSpacing
//topLayout->setSpacing( KDialog::spacingHint() );
//requires QT 5.2 or later.
defaultFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
OptionFontChooser* pFontChooser = new OptionFontChooser( defaultFont, "Font", &m_options.m_font, page, this );
topLayout->addWidget( pFontChooser );
......@@ -685,7 +682,7 @@ void OptionDialog::setupColorPage( void ) {
QVBoxLayout *topLayout = new QVBoxLayout( page );
topLayout->setMargin( 5 );
topLayout->setSpacing( KDialog::spacingHint() );
//QT5 topLayout->setSpacing( KDialog::spacingHint() );
QGridLayout *gbox = new QGridLayout();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment