Commit 8aa66b68 authored by Michael Reeves's avatar Michael Reeves

*fix crash on launch

*silence QCommandLineParser runtime messages
parent 8b3be928
......@@ -47,8 +47,8 @@ install(TARGETS kdiff3 ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES kdiff3part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kdiff3_part.rc DESTINATION ${DATA_INSTALL_DIR}/kdiff3part )
install( FILES kdiff3_shell.rc DESTINATION ${DATA_INSTALL_DIR}/kdiff3 )
install( FILES kdiff3_part.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kdiff3part )
install( FILES kdiff3_shell.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kdiff3 )
install( PROGRAMS kdiff3.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
ecm_install_icons(ICONS
......
......@@ -37,13 +37,13 @@
#include <QDesktopWidget>
#include <QPrinter>
#include <QPrintDialog>
#include <QFileDialog>
#include <QMenuBar>
#include <QStatusBar>
// include files for KDE
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <QMenuBar>
#include <QStatusBar>
#include <klocalizedstring.h>
#include <kconfig.h>
#include <kstandardaction.h>
......@@ -696,7 +696,7 @@ void KDiff3App::slotFileSave() {
void KDiff3App::slotFileSaveAs() {
slotStatusMsg( i18n( "Saving file with a new filename..." ) );
QString s = KFileDialog::getSaveUrl( QDir::currentPath(), 0, this, i18n( "Save As..." ) ).url();
QString s = QFileDialog::getSaveFileUrl(this, i18n( "Save As..." ), QDir::currentPath(), 0 ).url();
if( !s.isEmpty() ) {
m_outputFilename = s;
m_pMergeResultWindowTitle->setFileName( m_outputFilename );
......
......@@ -53,15 +53,15 @@ KDiff3Shell::KDiff3Shell( bool bCompleteInit )
// and a status bar
statusBar()->show();
const QVector<KPluginMetaData> plugin_offers = KPluginLoader::findPlugins( "kf5/kdiff3part" );
/*const QVector<KPluginMetaData> plugin_offers = KPluginLoader::findPlugins( "kf5/kdiff3part" );
foreach( const KPluginMetaData & service, plugin_offers ) {
KPluginFactory *factory = KPluginLoader( service.fileName() ).factory();
m_part = factory->create<KDiff3Part>( this, QVariantList() << QVariant( QLatin1String( "KDiff3Part" ) ) );
if( m_part )
break;
}
}*/
//m_part = new KDiff3Part( this, this, QVariantList() << QVariant(QLatin1String("KDiff3Part")) );
m_part = new KDiff3Part( this, this, QVariantList() << QVariant(QLatin1String("KDiff3Part")) );
if( m_part ) {
// and integrate the part's GUI with the shell's
......
......@@ -198,11 +198,6 @@ int main( int argc, char *argv[] ) {
KAboutData::setApplicationData( aboutData );
parser.addVersionOption();
parser.addHelpOption();
//PORTING SCRIPT: adapt aboutdata variable if necessary
aboutData.setupCommandLine( &parser );
aboutData.processCommandLine( &parser );
initialiseCmdLineArgs( parser );
// ignorable command options
parser.addOption( QCommandLineOption( QStringList() << QLatin1String( "m" ) << QLatin1String( "merge" ), i18n( "Merge the input." ) ) );
......@@ -225,6 +220,8 @@ int main( int argc, char *argv[] ) {
parser.addPositionalArgument( QLatin1String( "[File3]" ), i18n( "file3 to open" ) );
parser.process( app ); // PORTING SCRIPT: move this to after any parser.addOption
//must be after process or parse call
aboutData.setupCommandLine( &parser );
#ifdef KREPLACEMENTS_H
QString locale;
......
......@@ -34,8 +34,8 @@
#include <QMenu>
#include <QPushButton>
#include <QMimeData>
#include <QFileDialog>
#include <kfiledialog.h>
#include <klocale.h>
#include <kdebug.h>
......@@ -233,14 +233,14 @@ void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ) {
current = m_pLineA->currentText();
}
/*QUrl newURL = bDir ? KFileDialog::getExistingDirectoryUrl( current, this)
: bSave ? KFileDialog::getSaveUrl( current, "all/allfiles", this)
: KFileDialog::getOpenUrl( current, "all/allfiles", this);*/
QUrl newURL = bDir ? QFileDialog::getExistingDirectoryUrl( this, QString(), current)
: bSave ? QFileDialog::getSaveFileUrl( this, QString(), current, "all/allfiles")
: QFileDialog::getOpenFileUrl( this, QString(), current, "all/allfiles");
QUrl newURL;
/*QUrl newURL;
if( !bDir ) {
newURL = bSave ? KFileDialog::getSaveUrl( current, "all/allfiles", this )
: KFileDialog::getOpenUrl( current, "all/allfiles", this );
newURL = bSave ? QFileDialog::getSaveFileUrl( this, QString(), current, "all/allfiles" )
: QFileDialog::getOpenFileUrl( this, QString(), current, "all/allfiles" );
}
else {
KFileDialog dlg( current, "all/allfiles", this );
......@@ -251,15 +251,15 @@ void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ) {
dlg.setWindowTitle( i18n( "Select Directory" ) );
dlg.exec();
newURL = dlg.selectedUrl();
}
if( !newURL.isEmpty() ) {
}*/
/*if( !newURL.isEmpty() ) {
/*
Since we are selecting a directory open in the parent directory
not the one selected.
*/
KFileDialog::setStartDir( KIO::upUrl( newURL ) );
*
QFileDialog::setStartDir( KIO::upUrl( newURL ) );
pLine->setEditText( newURL.url() );
}
}*/
// newURL won't be modified if nothing was selected.
}
......
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