[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Couple patches
From: TAnGorN (Anatoli Gorchetchnikov) <anatoli () cns ! bu ! edu>
Date: 2001-07-27 20:49:12
[Download RAW message or body]
Oops :) Here they are.
On Friday 27 July 2001 15:53, Carsten Pfeiffer wrote:
> in case I didn't missed a second mail from you -- you forgot to
> attach the patches :)
>
> Cheers
> Carsten Pfeiffer
--
WBR,
TAnGorN
["doctools.patch" (text/plain)]
? doctools.patch
Index: Makefile.am
===================================================================
RCS file: /cvs/kdelibs/kdoctools/Makefile.am,v
retrieving revision 1.4
diff -u -3 -p -r1.4 Makefile.am
--- Makefile.am 2000/12/02 20:08:32 1.4
+++ Makefile.am 2001/07/20 22:19:45
@@ -1,7 +1,7 @@
## Makefile.am of kdebase/kioslave/man
-INCLUDES= $(all_includes)
-LDFLAGS = $(all_libraries) $(KDE_RPATH)
+INCLUDES= $(all_includes) -I../kio
+LDFLAGS = $(all_libraries) $(KDE_RPATH) -L../kio
####### Files
["kfile.patch" (text/x-c++)]
? kfile.patch
Index: kfiledialog.cpp
===================================================================
RCS file: /cvs/kdelibs/kfile/kfiledialog.cpp,v
retrieving revision 1.215
diff -u -3 -p -r1.215 kfiledialog.cpp
--- kfiledialog.cpp 2001/02/09 23:10:18 1.215
+++ kfiledialog.cpp 2001/07/25 21:09:49
@@ -66,6 +66,7 @@
#include <ktoolbarbutton.h>
#include <kurl.h>
#include <kurlcombobox.h>
+#include <netaccess.h>
#include "config-kfile.h"
@@ -452,10 +453,10 @@ void KFileDialog::slotOk()
// we can use our kfileitems, no need to parse anything
if ( items && !locationEdit->lineEdit()->edited() &&
!(items->isEmpty() && !dirOnly) ) {
-
+
d->urlList.clear();
d->filenames = QString::null;
-
+
if ( dirOnly ) {
d->url = ops->url();
}
@@ -473,7 +474,7 @@ void KFileDialog::slotOk()
}
}
}
-
+
accept();
return;
}
@@ -1420,23 +1421,43 @@ QString KFileDialog::getSaveFileName(con
KURL KFileDialog::getSaveURL(const QString& dir, const QString& filter,
QWidget *parent,
- const QString& caption)
+ const QString& caption,
+ bool overwriteQuery)
{
- KFileDialog dlg(dir, filter, parent, "filedialog", true);
- dlg.setCaption(caption.isNull() ? i18n("Save As") : caption);
- dlg.setKeepLocation( true );
-
- dlg.exec();
-
- KURL url = dlg.selectedURL();
- if (!url.isMalformed()) {
- if ( url.isLocalFile() )
- KRecentDocument::add( url.path(-1) );
- else
- KRecentDocument::add( url.url(-1) );
- }
+ KFileDialog dlg(dir, filter, parent, "filedialog", true);
+ dlg.setCaption(caption.isNull() ? i18n("Save As") : caption);
+ dlg.setKeepLocation( true );
+
+ int query;
+ QString dest;
+ KURL url;
+
+ do
+ {
+ query = KMessageBox::Yes;
+ dlg.exec();
+ url = dlg.selectedURL();
+ if(!url.isMalformed())
+ {
+ if(url.isLocalFile())
+ dest = url.path(-1);
+ else
+ dest = url.url(-1);
+
+ if(overwriteQuery && KIO::NetAccess::exists(url))
+ {
+ query = KMessageBox::warningYesNoCancel(parent,
+ i18n("A document with this name already \
exists.\nDo you want to overwrite it?")); + if(query == KMessageBox::Cancel)
+ return KURL();
+ }
+ }
+ }
+ while(query != KMessageBox::Yes);
- return url;
+ if (!url.isMalformed())
+ KRecentDocument::add(dest);
+ return url;
}
void KFileDialog::show()
Index: kfiledialog.h
===================================================================
RCS file: /cvs/kdelibs/kfile/kfiledialog.h,v
retrieving revision 1.87
diff -u -3 -p -r1.87 kfiledialog.h
--- kfiledialog.h 2000/12/07 21:32:13 1.87
+++ kfiledialog.h 2001/07/25 21:09:49
@@ -392,11 +392,14 @@ public:
* @param filter This is a space seperated list of shell globs.
* @param parent The widget the dialog will be centered on initially.
* @param caption The name of the dialog widget.
+ * @param owerwriteQuery If true standard dialog will request to
+ * confirm overwriting of existing file.
*/
static KURL getSaveURL(const QString& startDir= QString::null,
const QString& filter= QString::null,
QWidget *parent= 0,
- const QString& caption = QString::null);
+ const QString& caption = QString::null,
+ bool owerwriteQuery = false);
/**
* Create a modal file dialog and returns the selected
* directory or an empty string if none was chosen.
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic