From 763f62883120d098001a65f0bb3a431a3043d0d8 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Tue, 10 Jul 2012 14:47:59 +0200 Subject: [PATCH] Qt4: textedit improvements This patch sets the default document type in the "File save" dialog to HTML and makes both the "File open" and "File save" dialogs enter the "/" directory by default. Fixes #274. --- qt4/src/lib/qt4/textedit_example.patch | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/qt4/src/lib/qt4/textedit_example.patch b/qt4/src/lib/qt4/textedit_example.patch index 338e13014c..4ec3faf618 100644 --- a/qt4/src/lib/qt4/textedit_example.patch +++ b/qt4/src/lib/qt4/textedit_example.patch @@ -11,6 +11,33 @@ diff --git a/demos/textedit/main.cpp b/demos/textedit/main.cpp mw.show(); return a.exec(); } +diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp +--- a/demos/textedit/textedit.cpp ++++ b/demos/textedit/textedit.cpp +@@ -463,7 +463,7 @@ + void TextEdit::fileOpen() + { + QString fn = QFileDialog::getOpenFileName(this, tr("Open File..."), +- QString(), tr("HTML-Files (*.htm *.html);;All Files (*)")); ++ QString("/"), tr("HTML-Files (*.htm *.html);;All Files (*)")); + if (!fn.isEmpty()) + load(fn); + } +@@ -483,11 +483,11 @@ + bool TextEdit::fileSaveAs() + { + QString fn = QFileDialog::getSaveFileName(this, tr("Save as..."), +- QString(), tr("ODF files (*.odt);;HTML-Files (*.htm *.html);;All Files (*)")); ++ QString("/"), tr("HTML-Files (*.htm *.html);;All Files (*)")); + if (fn.isEmpty()) + return false; +- if (! (fn.endsWith(".odt", Qt::CaseInsensitive) || fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)) ) +- fn += ".odt"; // default ++ if (! (fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)) ) ++ fn += ".html"; // default + setCurrentFileName(fn); + return fileSave(); + } diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro --- a/demos/textedit/textedit.pro +++ b/demos/textedit/textedit.pro