[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 107201] Cervisia "Create patch against repository" does not
From: Christian Loose <christian.loose () hamburg ! de>
Date: 2005-06-23 18:52:11
Message-ID: 20050623185211.23411.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=107201
christian.loose hamburg de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Additional Comments From christian.loose hamburg de 2005-06-23 20:52 -------
SVN commit 428324 by cloose:
Be nice and ask before overwriting existing files.
BUG: 107201
M +3 -0 cervisiapart.cpp
M +3 -0 logdlg.cpp
M +22 -0 misc.cpp
M +2 -0 misc.h
M +1 -1 resolvedlg.cpp
--- trunk/KDE/kdesdk/cervisia/cervisiapart.cpp #428323:428324
@ -1335,6 +1335,9 @
if( fileName.isEmpty() )
return;
+ if( !Cervisia::CheckOverwrite(fileName) )
+ return;
+
QFile f(fileName);
if( !f.open(IO_WriteOnly) )
{
--- trunk/KDE/kdesdk/cervisia/logdlg.cpp #428323:428324
@ -466,6 +466,9 @
if( fileName.isEmpty() )
return;
+ if( !Cervisia::CheckOverwrite(fileName) )
+ return;
+
QFile f(fileName);
if( !f.open(IO_WriteOnly) )
{
--- trunk/KDE/kdesdk/cervisia/misc.cpp #428323:428324
@ -26,11 +26,13 @
#include <sys/types.h>
#include <unistd.h>
#include <qfile.h>
+#include <qfileinfo.h>
#include <qregexp.h>
#include <qstringlist.h>
#include <kconfig.h>
#include <kemailsettings.h>
#include <klocale.h>
+#include <kmessagebox.h>
#include <kprocess.h>
#include <ktempfile.h>
#include <kuser.h>
@ -204,6 +206,26 @
}
+bool Cervisia::CheckOverwrite(const QString& fileName)
+{
+ bool result = true;
+
+ QFileInfo fi(fileName);
+
+ // does the file already exist?
+ if( fi.exists() )
+ {
+ result = (KMessageBox::warningYesNo(0,
+ i18n("A file named \"%1\" already exists. Are you sure you want to \
overwrite it?").arg(fileName), + i18n("Overwrite File?"),
+ KGuiItem(i18n("&Overwrite"), "filesave", i18n("Overwrite the \
file")), + KStdGuiItem::cancel()) == KMessageBox::Yes);
+ }
+
+ return result;
+}
+
+
QString joinLine(const QStringList &list)
{
QString line;
--- trunk/KDE/kdesdk/cervisia/misc.h #428323:428324
@ -50,6 +50,8 @
*/
QString NormalizeRepository(const QString& repository);
+bool CheckOverwrite(const QString& fileName);
+
}
--- trunk/KDE/kdesdk/cervisia/resolvedlg.cpp #428323:428324
@ -579,7 +579,7 @
QString filename =
KFileDialog::getSaveFileName(0, 0, this, 0);
- if (!filename.isEmpty())
+ if( !filename.isEmpty() && Cervisia::CheckOverwrite(filename) )
saveFile(filename);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic