[kde-doc-english] [kig] modes: Port Away from KFileDialog in TypesDialog
David E. Narvaez
david.narvaez at computer.org
Thu Jun 4 17:53:02 UTC 2015
Git commit fc9af23cd88cfb23a1d626fa07bcb2e511969813 by David E. Narvaez.
Committed on 04/06/2015 at 16:52.
Pushed by narvaez into branch 'master'.
Port Away from KFileDialog in TypesDialog
GUI: The open/save file dialogs will no longer remember the location
where the user last saved types. Instead, they will always default to a
writable Documents location (e.g. ~/Documents).
M +3 -4 modes/typesdialog.cpp
http://commits.kde.org/kig/fc9af23cd88cfb23a1d626fa07bcb2e511969813
diff --git a/modes/typesdialog.cpp b/modes/typesdialog.cpp
index a163750..33ad730 100644
--- a/modes/typesdialog.cpp
+++ b/modes/typesdialog.cpp
@@ -27,7 +27,7 @@
#include "../misc/guiaction.h"
#include "../misc/object_constructor.h"
-#include <kfiledialog.h>
+#include <QFileDialog>
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -461,7 +461,7 @@ void TypesDialog::exportType()
types.push_back( macro );
}
if (types.empty()) return;
- QString file_name = KFileDialog::getSaveFileName( QUrl("kfiledialog:///macro"), i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Export Types" ) );
+ QString file_name = QFileDialog::getSaveFileName( this, i18n( "Export Types" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n("*.kigt|Kig Types Files\n*|All Files") );
if ( file_name.isNull() )
return;
QFile fi( file_name );
@@ -475,8 +475,7 @@ void TypesDialog::exportType()
void TypesDialog::importTypes()
{
- QStringList file_names =
- KFileDialog::getOpenFileNames( QUrl("kfiledialog:///importTypes"), i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Import Types" ));
+ QStringList file_names = QFileDialog::getOpenFileNames( this, i18n( "Import Types" ), QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ), i18n("*.kigt|Kig Types Files\n*|All Files") );
std::vector<Macro*> macros;
More information about the kde-doc-english
mailing list