[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kio] src/kcms/kio: GUI option to configure global MarkPartial for KIO slaves
From: Martin_Kostolný <clearmartin () zoho ! com>
Date: 2016-08-01 3:12:41
Message-ID: E1bU3ej-0008H7-1V () code ! kde ! org
[Download RAW message or body]
Git commit 19568657af443b085e4e534f1be96410e75155b3 by Martin Kostolný.
Committed on 01/08/2016 at 03:10.
Pushed by martinkostolny into branch 'master'.
GUI option to configure global MarkPartial for KIO slaves
REVIEW: 127154
M +7 -0 src/kcms/kio/kioslave.kcfg
M +21 -0 src/kcms/kio/netpref.cpp
M +1 -0 src/kcms/kio/netpref.h
http://commits.kde.org/kio/19568657af443b085e4e534f1be96410e75155b3
diff --git a/src/kcms/kio/kioslave.kcfg b/src/kcms/kio/kioslave.kcfg
index d34b691..b017d4a 100644
--- a/src/kcms/kio/kioslave.kcfg
+++ b/src/kcms/kio/kioslave.kcfg
@@ -29,6 +29,13 @@
<max>3600</max>
</entry>
</group>
+ <group name="Global Options">
+ <entry name="MarkPartial" type="Bool">
+ <label>Mark partially uploaded files</label>
+ <whatsthis>While a file is being uploaded its extension is ".part". When fully \
uploaded it is renamed to its real name.</whatsthis> + <default>true</default>
+ </entry>
+ </group>
<group name="Proxy Settings" >
<entry name="AuthMode" type="String" >
</entry>
diff --git a/src/kcms/kio/netpref.cpp b/src/kcms/kio/netpref.cpp
index 24273a3..3095215 100644
--- a/src/kcms/kio/netpref.cpp
+++ b/src/kcms/kio/netpref.cpp
@@ -64,6 +64,21 @@ KIOPreferences::KIOPreferences(QWidget *parent, const QVariantList \
&)
connect(sb_serverResponse, SIGNAL(valueChanged(int)), SLOT(configChanged()));
timeoutLayout->addRow(i18n("&Server response:"), sb_serverResponse);
+ QGroupBox* gb_Global = new QGroupBox( i18n( "Global Options" ), this );
+ mainLayout->addWidget( gb_Global );
+ QVBoxLayout* globalLayout = new QVBoxLayout(gb_Global);
+
+ cb_globalMarkPartial = new QCheckBox( i18n( "Mark &partially uploaded files" ), \
this ); + cb_globalMarkPartial->setWhatsThis( i18n( "<p>Marks partially uploaded \
files " + "through SMB, SFTP and other \
protocols." + "</p><p>When this option is "
+ "enabled, partially uploaded files "
+ "will have a \".part\" extension. "
+ "This extension will be removed "
+ "once the transfer is complete.</p>") );
+ connect(cb_globalMarkPartial, SIGNAL(toggled(bool)), SLOT(configChanged()));
+ globalLayout->addWidget(cb_globalMarkPartial);
+
gb_Ftp = new QGroupBox( i18n( "FTP Options" ), this );
mainLayout->addWidget( gb_Ftp );
QVBoxLayout* ftpLayout = new QVBoxLayout(gb_Ftp);
@@ -106,6 +121,8 @@ void KIOPreferences::load()
sb_serverConnect->setValue( proto.connectTimeout() );
sb_proxyConnect->setValue( proto.proxyConnectTimeout() );
+ cb_globalMarkPartial->setChecked( proto.markPartial() );
+
KConfig config( QStringLiteral("kio_ftprc"), KConfig::NoGlobals );
cb_ftpEnablePasv->setChecked( !config.group("").readEntry( "DisablePassiveMode", \
false ) ); cb_ftpMarkPartial->setChecked( config.group("").readEntry( "MarkPartial", \
true ) ); @@ -119,6 +136,8 @@ void KIOPreferences::save()
KSaveIOConfig::setConnectTimeout( sb_serverConnect->value() );
KSaveIOConfig::setProxyConnectTimeout( sb_proxyConnect->value() );
+ KSaveIOConfig::setMarkPartial( cb_globalMarkPartial->isChecked() );
+
KConfig config(QStringLiteral("kio_ftprc"), KConfig::NoGlobals);
config.group("").writeEntry( "DisablePassiveMode", !cb_ftpEnablePasv->isChecked() \
); config.group("").writeEntry( "MarkPartial", cb_ftpMarkPartial->isChecked() );
@@ -136,6 +155,8 @@ void KIOPreferences::defaults()
sb_serverConnect->setValue( DEFAULT_CONNECT_TIMEOUT );
sb_proxyConnect->setValue( DEFAULT_PROXY_CONNECT_TIMEOUT );
+ cb_globalMarkPartial->setChecked( true );
+
cb_ftpEnablePasv->setChecked( true );
cb_ftpMarkPartial->setChecked( true );
diff --git a/src/kcms/kio/netpref.h b/src/kcms/kio/netpref.h
index f7a0abc..32174ef 100644
--- a/src/kcms/kio/netpref.h
+++ b/src/kcms/kio/netpref.h
@@ -28,6 +28,7 @@ protected Q_SLOTS:
private:
QGroupBox* gb_Ftp;
QGroupBox* gb_Timeout;
+ QCheckBox* cb_globalMarkPartial;
QCheckBox* cb_ftpEnablePasv;
QCheckBox* cb_ftpMarkPartial;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic