summaryrefslogtreecommitdiffstats
path: root/tdeio/tdefile/kpropertiesdialog.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-01-28 23:12:32 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-01-28 23:12:32 +0900
commit394c9f5c0e1b464aa8bc22bd65c5268acd43994d (patch)
tree39db9b6670e6ffce93a53f790593e15c0394997d /tdeio/tdefile/kpropertiesdialog.cpp
parentecd1e4bd401a00be11f4d8bbaff01718f29f9118 (diff)
downloadtdelibs-394c9f5c0e1b464aa8bc22bd65c5268acd43994d.tar.gz
tdelibs-394c9f5c0e1b464aa8bc22bd65c5268acd43994d.zip
Improved support for XDG folders without requiring xdg-user-dirs to be installed.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeio/tdefile/kpropertiesdialog.cpp')
-rw-r--r--tdeio/tdefile/kpropertiesdialog.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/tdeio/tdefile/kpropertiesdialog.cpp b/tdeio/tdefile/kpropertiesdialog.cpp
index 0aaf2f40e..ae8aae85d 100644
--- a/tdeio/tdefile/kpropertiesdialog.cpp
+++ b/tdeio/tdefile/kpropertiesdialog.cpp
@@ -2630,13 +2630,7 @@ KURLPropsPlugin::KURLPropsPlugin( KPropertiesDialog *_props )
KFileItem * item = properties->item();
- if (item && item->mimetype() == "media/builtin-mydocuments") {
- URLStr = TQString::null;
- TDEConfig xdguserconfig( TQDir::homeDirPath()+"/.config/user-dirs.dirs" );
- URLEdit->setMode(KFile::Directory);
- URLEdit->setURL( xdguserconfig.readPathEntry( "XDG_DOCUMENTS_DIR", TQDir::homeDirPath() + "/Documents").remove( "\"" ));
- }
- else if (item && item->mimetype().startsWith("media/builtin-")) {
+ if (item && item->mimetype().startsWith("media/builtin-")) {
URLEdit->setEnabled(false);
}
@@ -2679,20 +2673,7 @@ void KURLPropsPlugin::applyChanges()
TQString path = properties->kurl().path();
KFileItem * item = properties->item();
- if (item && item->mimetype() == "media/builtin-mydocuments") {
- TDEConfig xdgconfig(TQDir::homeDirPath()+"/.config/user-dirs.dirs" );
- if (xdgconfig.isReadOnly()) {
- KMessageBox::sorry( 0, i18n("<qt>Could not save properties. You do not have "
- "sufficient access to write to <b>%1</b>.</qt>").arg(path));
- return;
- }
- else {
- xdgconfig.writePathEntry( "XDG_DOCUMENTS_DIR", '"'+ URLEdit->url() + '"', true, false, false, false );
- xdgconfig.sync();
- return;
- }
- }
- else if (item && item->mimetype().startsWith("media/builtin-")) {
+ if (item && item->mimetype().startsWith("media/builtin-")) {
return;
}