summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Reinholdt <alexander.reinholdt@kdemail.net>2014-03-09 11:50:05 (GMT)
committerAlexander Reinholdt <alexander.reinholdt@kdemail.net>2014-03-09 11:50:05 (GMT)
commita59f76698b51c9c3a79338243355c163783bcdad (patch)
tree3df04d10f8e8d66346a39eb024bb2707ed3e6646
parent211d9680deaee4bc4c1ac760adf36a8a534714c2 (diff)
Implement permanent (re)mounting of shares. This closes SF ticket #33.
-rw-r--r--core/smb4kcustomoptions.cpp35
-rw-r--r--core/smb4kcustomoptions.h16
-rw-r--r--core/smb4kcustomoptionsmanager.cpp161
-rw-r--r--core/smb4kcustomoptionsmanager.h29
-rw-r--r--core/smb4kcustomoptionsmanager_p.cpp70
-rw-r--r--core/smb4kcustomoptionsmanager_p.h3
-rw-r--r--core/smb4kmounter.cpp17
-rw-r--r--smb4k/CMakeLists.txt2
-rw-r--r--smb4k/configdlg/smb4kcustomoptionspage.cpp10
-rw-r--r--smb4k/configdlg/smb4kshareoptionspage.cpp41
10 files changed, 272 insertions, 112 deletions
diff --git a/core/smb4kcustomoptions.cpp b/core/smb4kcustomoptions.cpp
index 4a6fca3..dfe2519 100644
--- a/core/smb4kcustomoptions.cpp
+++ b/core/smb4kcustomoptions.cpp
@@ -2,7 +2,7 @@
smb4kcustomoptions - This class carries custom options
-------------------
begin : Fr 29 Apr 2011
- copyright : (C) 2011-2013 by Alexander Reinholdt
+ copyright : (C) 2011-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -540,16 +540,21 @@ QMap<QString, QString> Smb4KCustomOptions::customOptions() const
switch ( d->remount )
{
- case DoRemount:
+ case RemountOnce:
{
- entries.insert( "remount", "true" );
+ entries.insert( "remount", "once" );
break;
}
- case NoRemount:
+ case RemountAlways:
{
- entries.insert( "remount", "false" );
+ entries.insert( "remount", "always" );
break;
}
+ case RemountNever:
+ {
+ entries.insert( "remount", "never" );
+ break;
+ }
case UndefinedRemount:
{
entries.insert( "remount", QString() );
@@ -767,6 +772,16 @@ bool Smb4KCustomOptions::equals( Smb4KCustomOptions *options ) const
{
// Do nothing
}
+
+ // Remounting
+ if ( d->remount != options->remount() )
+ {
+ return false;
+ }
+ else
+ {
+ // Do nothing
+ }
// SMB port
if ( d->smbPort != options->smbPort() )
@@ -926,6 +941,16 @@ bool Smb4KCustomOptions::isEmpty()
{
// Do nothing
}
+
+ // Remounting
+ if ( d->remount != Smb4KCustomOptions::UndefinedRemount )
+ {
+ return false;
+ }
+ else
+ {
+ // Do nothing
+ }
// SMB port
if ( d->smbPort != 139 )
diff --git a/core/smb4kcustomoptions.h b/core/smb4kcustomoptions.h
index 9f88dcc..14039e3 100644
--- a/core/smb4kcustomoptions.h
+++ b/core/smb4kcustomoptions.h
@@ -2,7 +2,7 @@
smb4kcustomoptions - This class carries custom options
-------------------
begin : Fr 29 Apr 2011
- copyright : (C) 2011-2013 by Alexander Reinholdt
+ copyright : (C) 2011-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -44,7 +44,7 @@ class Smb4KCustomOptionsPrivate;
using namespace Smb4KGlobal;
/**
- * This class stored the custom options defined for a certain host
+ * This class stores the custom options defined for a certain host
* or share.
*
* @author Alexander Reinholdt <alexander.reinholdt@kdemail.net>
@@ -58,9 +58,17 @@ class KDE_EXPORT Smb4KCustomOptions
public:
/**
* Remount enumeration
+ *
+ * @param RemountOnce Remount the share only next time the application
+ * is started.
+ * @param RemountAlways Remount the share everytime the application is
+ * started.
+ * @param RemountNever Never remount the share.
+ * @param UndefinedRemount No remount option is defined.
*/
- enum Remount { DoRemount,
- NoRemount,
+ enum Remount { RemountOnce,
+ RemountAlways,
+ RemountNever,
UndefinedRemount };
/**
diff --git a/core/smb4kcustomoptionsmanager.cpp b/core/smb4kcustomoptionsmanager.cpp
index 492213e..db66836 100644
--- a/core/smb4kcustomoptionsmanager.cpp
+++ b/core/smb4kcustomoptionsmanager.cpp
@@ -2,7 +2,7 @@
smb4kcustomoptionsmanager - Manage custom options
-------------------
begin : Fr 29 Apr 2011
- copyright : (C) 2011-2013 by Alexander Reinholdt
+ copyright : (C) 2011-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -82,50 +82,95 @@ Smb4KCustomOptionsManager *Smb4KCustomOptionsManager::self()
}
-void Smb4KCustomOptionsManager::addRemount( Smb4KShare *share )
+void Smb4KCustomOptionsManager::addRemount( Smb4KShare *share, bool always )
{
Q_ASSERT( share );
- Smb4KCustomOptions *options = NULL;
-
- if ( (options = findOptions( share, true )) )
+ if ( share )
{
- options->setRemount( Smb4KCustomOptions::DoRemount );
+ Smb4KCustomOptions *options = NULL;
+
+ if ( (options = findOptions( share, true )) )
+ {
+ // If the options are already in the list, check if the share is
+ // always to be remounted. If so, ignore the 'always' argument
+ // and leave that option untouched.
+ if ( options->remount() != Smb4KCustomOptions::RemountAlways )
+ {
+ options->setRemount( always ? Smb4KCustomOptions::RemountAlways : Smb4KCustomOptions::RemountOnce );
+ }
+ else
+ {
+ // Do nothing
+ }
+ }
+ else
+ {
+ options = new Smb4KCustomOptions( share );
+ options->setRemount( always ? Smb4KCustomOptions::RemountAlways : Smb4KCustomOptions::RemountOnce );
+ d->options << options;
+ }
}
else
{
- options = new Smb4KCustomOptions( share );
- options->setRemount( Smb4KCustomOptions::DoRemount );
- d->options << options;
+ // Do nothing
}
}
-void Smb4KCustomOptionsManager::removeRemount( Smb4KShare *share )
+void Smb4KCustomOptionsManager::removeRemount( Smb4KShare *share, bool force )
{
Q_ASSERT( share );
- Smb4KCustomOptions *options = NULL;
-
- if ( (options = findOptions( share, true )) )
+ if ( share )
{
- options->setRemount( Smb4KCustomOptions::NoRemount );
+ Smb4KCustomOptions *options = NULL;
+
+ if ( (options = findOptions( share, true )) )
+ {
+ if ( options->remount() == Smb4KCustomOptions::RemountOnce )
+ {
+ options->setRemount( Smb4KCustomOptions::RemountNever );
+ }
+ else if ( options->remount() == Smb4KCustomOptions::RemountAlways && force )
+ {
+ options->setRemount( Smb4KCustomOptions::RemountNever );
+ }
+ else
+ {
+ // Do nothing
+ }
+ }
+ else
+ {
+ // Do nothing
+ }
}
else
{
// Do nothing
- }
+ }
}
-void Smb4KCustomOptionsManager::clearRemounts()
+void Smb4KCustomOptionsManager::clearRemounts( bool force )
{
for ( int i = 0; i < d->options.size(); ++i )
{
- if ( d->options.at( i )->type() == Share &&
- d->options.at( i )->remount() == Smb4KCustomOptions::DoRemount )
+ if ( d->options.at(i)->type() == Share )
{
- d->options[i]->setRemount( Smb4KCustomOptions::NoRemount );
+ if ( d->options.at(i)->remount() == Smb4KCustomOptions::RemountOnce )
+ {
+ d->options[i]->setRemount( Smb4KCustomOptions::RemountNever );
+ }
+ else if ( d->options.at(i)->remount() == Smb4KCustomOptions::RemountAlways && force )
+ {
+ d->options[i]->setRemount( Smb4KCustomOptions::RemountNever );
+ }
+ else
+ {
+ // Do nothing
+ }
}
else
{
@@ -141,7 +186,11 @@ QList<Smb4KCustomOptions *> Smb4KCustomOptionsManager::sharesToRemount()
for ( int i = 0; i < d->options.size(); ++i )
{
- if ( d->options.at( i )->remount() == Smb4KCustomOptions::DoRemount )
+ if ( d->options.at( i )->remount() == Smb4KCustomOptions::RemountOnce )
+ {
+ remounts << d->options[i];
+ }
+ else if ( d->options.at( i )->remount() == Smb4KCustomOptions::RemountAlways )
{
remounts << d->options[i];
}
@@ -297,11 +346,9 @@ void Smb4KCustomOptionsManager::readCustomOptions()
if ( xmlReader.isStartElement() )
{
- // FIXME: Drop version 1.0 with the next revision
if ( xmlReader.name() == "custom_options" &&
- (xmlReader.attributes().value( "version" ) != "1.0" &&
- xmlReader.attributes().value( "version" ) != "1.1" &&
- xmlReader.attributes().value( "version" ) != "1.2") )
+ (xmlReader.attributes().value( "version" ) != "1.2" &&
+ xmlReader.attributes().value( "version" ) != "2.0") )
{
xmlReader.raiseError( i18n( "The format of %1 is not supported.", xmlFile.fileName() ) );
break;
@@ -353,44 +400,33 @@ void Smb4KCustomOptionsManager::readCustomOptions()
{
QString remount = xmlReader.readElementText();
- if ( QString::compare( remount, "true" ) == 0 )
+ // FIXME: Remove the entries "true" and "false" with the next
+ // revision (i.e. Smb4K > 1.2).
+ if ( QString::compare( remount, "once" ) == 0 )
+ {
+ options->setRemount( Smb4KCustomOptions::RemountOnce );
+ }
+ else if ( QString::compare( remount, "always" ) == 0 )
+ {
+ options->setRemount( Smb4KCustomOptions::RemountAlways );
+ }
+ else if ( QString::compare( remount, "never" ) == 0 )
+ {
+ options->setRemount( Smb4KCustomOptions::RemountNever );
+ }
+ else if ( QString::compare( remount, "true" ) == 0 )
{
- options->setRemount( Smb4KCustomOptions::DoRemount );
+ options->setRemount( Smb4KCustomOptions::RemountOnce );
}
else if ( QString::compare( remount, "false" ) == 0 )
{
- options->setRemount( Smb4KCustomOptions::NoRemount );
+ options->setRemount( Smb4KCustomOptions::RemountNever );
}
else
{
options->setRemount( Smb4KCustomOptions::UndefinedRemount );
}
}
- else if ( xmlReader.name() == "port" )
- {
- // FIXME: For backward compatibility. Remove with versions >> 1.0.x.
-#ifndef Q_OS_FREEBSD
- switch ( options->type() )
- {
- case Host:
- {
- options->setSMBPort( xmlReader.readElementText().toInt() );
- break;
- }
- case Share:
- {
- options->setFileSystemPort( xmlReader.readElementText().toInt() );
- break;
- }
- default:
- {
- break;
- }
- }
-#else
- options->setSMBPort( xmlReader.readElementText().toInt() );
-#endif
- }
else if ( xmlReader.name() == "smb_port" )
{
options->setSMBPort( xmlReader.readElementText().toInt() );
@@ -617,13 +653,14 @@ void Smb4KCustomOptionsManager::writeCustomOptions()
xmlWriter.setAutoFormatting( true );
xmlWriter.writeStartDocument();
xmlWriter.writeStartElement( "custom_options" );
- xmlWriter.writeAttribute( "version", "1.2" );
+ xmlWriter.writeAttribute( "version", "2.0" );
for ( int i = 0; i < d->options.size(); ++i )
{
Smb4KCustomOptions *options = d->options[i];
- if ( hasCustomOptions( options ) || options->remount() == Smb4KCustomOptions::DoRemount )
+ if ( hasCustomOptions( options ) ||
+ options->remount() == Smb4KCustomOptions::RemountOnce )
{
xmlWriter.writeStartElement( "options" );
xmlWriter.writeAttribute( "type", options->type() == Host ? "host" : "share" );
@@ -687,7 +724,8 @@ const QList<Smb4KCustomOptions *> Smb4KCustomOptionsManager::customOptions( bool
{
Smb4KCustomOptions *options = d->options[i];
- if ( hasCustomOptions( options ) || (!optionsOnly && options->remount() == Smb4KCustomOptions::DoRemount) )
+ if ( hasCustomOptions( options ) ||
+ (!optionsOnly && options->remount() == Smb4KCustomOptions::RemountOnce) )
{
custom_options << options;
}
@@ -718,7 +756,7 @@ void Smb4KCustomOptionsManager::replaceCustomOptions( const QList<Smb4KCustomOpt
{
d->options << new Smb4KCustomOptions( *options );
}
- else if ( options->remount() == Smb4KCustomOptions::DoRemount )
+ else if ( options->remount() == Smb4KCustomOptions::RemountOnce )
{
d->options << new Smb4KCustomOptions( *options );
}
@@ -1097,11 +1135,20 @@ bool Smb4KCustomOptionsManager::hasCustomOptions( Smb4KCustomOptions *options )
default_options.setUID( (K_UID)Smb4KSettings::userID().toInt() );
default_options.setGID( (K_GID)Smb4KSettings::groupID().toInt() );
- // WOL features have no default values.
+ // NOTE: WOL features and remounting do not have default values.
//
// Do the actual check
//
+
+ if ( options->remount() == Smb4KCustomOptions::RemountAlways )
+ {
+ return true;
+ }
+ else
+ {
+ // Do nothing
+ }
// SMB port
if ( empty_options.smbPort() != options->smbPort() &&
diff --git a/core/smb4kcustomoptionsmanager.h b/core/smb4kcustomoptionsmanager.h
index 653d9d8..7faae26 100644
--- a/core/smb4kcustomoptionsmanager.h
+++ b/core/smb4kcustomoptionsmanager.h
@@ -2,7 +2,7 @@
smb4kcustomoptionsmanager - Manage custom options
-------------------
begin : Fr 29 Apr 2011
- copyright : (C) 2011-2013 by Alexander Reinholdt
+ copyright : (C) 2011-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -76,24 +76,37 @@ class KDE_EXPORT Smb4KCustomOptionsManager : public QObject
/**
* Add the share to the list of shares that are to be remounted
- * next time.
+ * either only on next program start or always Smb4K is restarted.
*
* @param share The share object
+ *
+ * @param always If set to TRUE the share is always mounted
+ * when Smb4K is restarted.
*/
- void addRemount( Smb4KShare *share );
+ void addRemount( Smb4KShare *share, bool always = false );
/**
- * Remove the share @p share from the list of shares that are to
- * be remounted the next time.
+ * Remove the share @p share from the list of shares that are to be
+ * remounted. If @p force is set to TRUE, the share is removed even
+ * if it should always be removed (option is set to
+ * Smb4KCustomOptions::AlwaysRemount). Apart from that, the share is only
+ * removed when the option is set to Smb4KCustomOptions::DoRemount.
*
* @param share The share object
+ *
+ * @param force If set to TRUE, the share is removed regardless of the
+ * remount setting.
*/
- void removeRemount( Smb4KShare *share );
+ void removeRemount( Smb4KShare *share, bool force = false );
/**
- * Removes all remounts from the list of custom options.
+ * Removes all remounts from the list of custom options. If @p force
+ * is set to TRUE, even those are removed that should always be remounted.
+ *
+ * @param force If set to TRUE, even those shares are removed that should
+ * always be remounted.
*/
- void clearRemounts();
+ void clearRemounts( bool force );
/**
* Returns the list of shares that are to be remounted.
diff --git a/core/smb4kcustomoptionsmanager_p.cpp b/core/smb4kcustomoptionsmanager_p.cpp
index b367354..2ab3af9 100644
--- a/core/smb4kcustomoptionsmanager_p.cpp
+++ b/core/smb4kcustomoptionsmanager_p.cpp
@@ -3,7 +3,7 @@
Smb4KCustomOptionsManager class
-------------------
begin : Fr 29 Apr 2011
- copyright : (C) 2011-2012 by Alexander Reinholdt
+ copyright : (C) 2011-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -136,7 +136,34 @@ void Smb4KCustomOptionsDialog::setupView()
general_layout->addWidget( unc, 0, 1, 0 );
general_layout->addWidget( ip_label, 1, 0, 0 );
general_layout->addWidget( ip, 1, 1, 0 );
+
+ if ( m_options->type() == Share )
+ {
+ m_remount = new QCheckBox( i18n( "Always remount this share" ), general );
+ m_remount->setChecked( (m_options->remount() == Smb4KCustomOptions::RemountAlways) );
+ general_layout->addWidget( m_remount, 2, 0, 1, 2, 0 );
+ }
+ else
+ {
+ m_remount = NULL;
+ }
+
+ switch ( m_options->type() )
+ {
+ case Host:
+ {
+ break;
+ }
+ case Share:
+ {
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
//
// Tab widget with settings
@@ -593,6 +620,22 @@ void Smb4KCustomOptionsDialog::setupView()
bool Smb4KCustomOptionsDialog::defaultValues()
{
+ if ( m_options->type() == Share )
+ {
+ if ( m_remount->isChecked() != false )
+ {
+ return false;
+ }
+ else
+ {
+ // Do nothing
+ }
+ }
+ else
+ {
+ // Do nothing
+ }
+
if ( m_smb_port->value() != Smb4KSettings::remoteSMBPort() )
{
return false;
@@ -717,6 +760,15 @@ bool Smb4KCustomOptionsDialog::defaultValues()
void Smb4KCustomOptionsDialog::slotSetDefaultValues()
{
+ if ( m_options->type() == Share )
+ {
+ m_remount->setChecked( false );
+ }
+ else
+ {
+ // Do nothing
+ }
+
m_smb_port->setValue( Smb4KSettings::remoteSMBPort() );
#ifndef Q_OS_FREEBSD
m_fs_port->setValue( Smb4KSettings::remoteFileSystemPort() );
@@ -871,6 +923,22 @@ void Smb4KCustomOptionsDialog::slotCheckValues()
void Smb4KCustomOptionsDialog::slotOKClicked()
{
+ if ( m_options->type() == Share )
+ {
+ if ( m_remount->isChecked() )
+ {
+ m_options->setRemount( Smb4KCustomOptions::RemountAlways );
+ }
+ else
+ {
+ m_options->setRemount( Smb4KCustomOptions::RemountNever );
+ }
+ }
+ else
+ {
+ // Do nothing
+ }
+
m_options->setSMBPort( m_smb_port->value() );
#ifndef Q_OS_FREEBSD
m_options->setFileSystemPort( m_fs_port->value() );
diff --git a/core/smb4kcustomoptionsmanager_p.h b/core/smb4kcustomoptionsmanager_p.h
index dc6ee94..a736668 100644
--- a/core/smb4kcustomoptionsmanager_p.h
+++ b/core/smb4kcustomoptionsmanager_p.h
@@ -3,7 +3,7 @@
Smb4KCustomOptionsManager class
-------------------
begin : Fr 29 Apr 2011
- copyright : (C) 2011-2012 by Alexander Reinholdt
+ copyright : (C) 2011-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -67,6 +67,7 @@ class Smb4KCustomOptionsDialog : public KDialog
void setupView();
bool defaultValues();
Smb4KCustomOptions *m_options;
+ QCheckBox *m_remount;
KIntNumInput *m_smb_port;
#ifndef Q_OS_FREEBSD
KIntNumInput *m_fs_port;
diff --git a/core/smb4kmounter.cpp b/core/smb4kmounter.cpp
index 72b0e17..b6e848f 100644
--- a/core/smb4kmounter.cpp
+++ b/core/smb4kmounter.cpp
@@ -233,7 +233,9 @@ bool Smb4KMounter::isRunning()
void Smb4KMounter::triggerRemounts( bool fill_list )
{
- if ( Smb4KSettings::remountShares() || d->hardwareReason )
+ if ( Smb4KSettings::remountShares() /* one-time remounts */ ||
+ !Smb4KCustomOptionsManager::self()->sharesToRemount().isEmpty() /* permanent remounts */ ||
+ d->hardwareReason /* hardware reason */ )
{
if ( fill_list )
{
@@ -1363,25 +1365,25 @@ void Smb4KMounter::saveSharesForRemount()
{
if ( !mountedSharesList().at( i )->isForeign() )
{
- Smb4KCustomOptionsManager::self()->addRemount( mountedSharesList().at( i ) );
+ Smb4KCustomOptionsManager::self()->addRemount( mountedSharesList().at( i ), false );
}
else
{
- Smb4KCustomOptionsManager::self()->removeRemount( mountedSharesList().at( i ) );
+ Smb4KCustomOptionsManager::self()->removeRemount( mountedSharesList().at( i ), false );
}
}
// Save failed remounts.
for ( int i = 0; i < d->remounts.size(); ++i )
{
- Smb4KCustomOptionsManager::self()->addRemount( d->remounts.at( i ) );
+ Smb4KCustomOptionsManager::self()->addRemount( d->remounts.at( i ), false );
}
}
else
{
if ( !Smb4KSettings::remountShares() )
{
- Smb4KCustomOptionsManager::self()->clearRemounts();
+ Smb4KCustomOptionsManager::self()->clearRemounts( false );
}
else
{
@@ -1470,7 +1472,8 @@ void Smb4KMounter::timerEvent( QTimerEvent * )
// before. Do this only if there are no subjobs, because we
// do not want to get crashes because a share was invalidated
// during processing the shares.
- if ( Smb4KSettings::remountShares() && Smb4KSettings::remountAttempts() > d->remountAttempts )
+ if ( (Smb4KSettings::remountShares() || !Smb4KCustomOptionsManager::self()->sharesToRemount().isEmpty()) &&
+ Smb4KSettings::remountAttempts() > d->remountAttempts )
{
// Inhibit automatic sleeping.
int cookie = Smb4KSolidInterface::self()->beginSleepSuppression(i18n("Remounting shares. Please wait."));
@@ -1726,7 +1729,7 @@ void Smb4KMounter::slotShareMounted( Smb4KShare *share )
if ( Smb4KSettings::remountShares() )
{
- Smb4KCustomOptionsManager::self()->removeRemount( known_share );
+ Smb4KCustomOptionsManager::self()->removeRemount( known_share, false );
}
else
{
diff --git a/smb4k/CMakeLists.txt b/smb4k/CMakeLists.txt
index c963f8e..10db977 100644
--- a/smb4k/CMakeLists.txt
+++ b/smb4k/CMakeLists.txt
@@ -23,7 +23,6 @@ set( smb4k_SRCS
smb4kmainwindow.cpp
smb4ksystemtray.cpp )
-#kde4_add_app_icon( smb4k_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/smb4k.png" )
kde4_add_executable( smb4k ${smb4k_SRCS} )
target_link_libraries( smb4k
@@ -33,7 +32,6 @@ target_link_libraries( smb4k
${KDE4_KDEUI_LIBS}
${KDE4_KPARTS_LIBS} )
-#install( TARGETS smb4k ${INSTALL_TARGETS_DEFAULT_ARGS} )
install( TARGETS smb4k DESTINATION ${BIN_INSTALL_DIR} )
########### install files ###############
diff --git a/smb4k/configdlg/smb4kcustomoptionspage.cpp b/smb4k/configdlg/smb4kcustomoptionspage.cpp
index 99531d5..cac5506 100644
--- a/smb4k/configdlg/smb4kcustomoptionspage.cpp
+++ b/smb4k/configdlg/smb4kcustomoptionspage.cpp
@@ -3,7 +3,7 @@
options
-------------------
begin : Sa Jan 19 2013
- copyright : (C) 2013 by Alexander Reinholdt
+ copyright : (C) 2013-2014 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
@@ -124,7 +124,7 @@ Smb4KCustomOptionsPage::Smb4KCustomOptionsPage( QWidget *parent ) : QWidget( par
ip_label->setBuddy( m_ip_address );
- m_remount_share = new QCheckBox( i18n( "Remount this share" ), m_general_editors );
+ m_remount_share = new QCheckBox( i18n( "Always remount this share" ), m_general_editors );
general_editor_layout->addWidget( unc_label, 0, 0, 0 );
general_editor_layout->addWidget( m_unc_address, 0, 1, 0 );
@@ -649,7 +649,7 @@ void Smb4KCustomOptionsPage::populateEditors(Smb4KCustomOptions* options)
// Do nothing
}
- if ( m_current_options->remount() == Smb4KCustomOptions::DoRemount )
+ if ( m_current_options->remount() == Smb4KCustomOptions::RemountAlways )
{
m_remount_share->setChecked( true );
}
@@ -966,11 +966,11 @@ void Smb4KCustomOptionsPage::commitChanges()
if ( m_remount_share->isChecked() )
{
- options->setRemount( Smb4KCustomOptions::DoRemount );
+ options->setRemount( Smb4KCustomOptions::RemountAlways );
}
else
{
- options->setRemount( Smb4KCustomOptions::NoRemount );
+ options->setRemount( Smb4KCustomOptions::RemountNever );
}
options->setSMBPort( m_smb_port->value() );
diff --git a/smb4k/configdlg/smb4kshareoptionspage.cpp b/smb4k/configdlg/smb4kshareoptionspage.cpp
index 1de97bb..a2761cc 100644
--- a/smb4k/configdlg/smb4kshareoptionspage.cpp
+++ b/smb4k/configdlg/smb4kshareoptionspage.cpp
@@ -81,30 +81,27 @@ Smb4KShareOptionsPage::Smb4KShareOptionsPage( QWidget *parent )
QGridLayout *mount_layout = new QGridLayout( mount_box );
mount_layout->setSpacing( 5 );
-
- QCheckBox *unmount_all_shares = new QCheckBox( Smb4KSettings::self()->unmountSharesOnExitItem()->label(),
- mount_box );
- unmount_all_shares->setObjectName( "kcfg_UnmountSharesOnExit" );
-
-
- QCheckBox *remount_shares = new QCheckBox( Smb4KSettings::self()->remountSharesItem()->label(),
- mount_box );
- remount_shares->setObjectName( "kcfg_RemountShares" );
-
+
QLabel *rem_attempts_label = new QLabel( Smb4KSettings::self()->remountAttemptsItem()->label(),
mount_box );
- rem_attempts_label->setIndent( 30 );
KIntNumInput *remount_attempts = new KIntNumInput( mount_box );
remount_attempts->setObjectName( "kcfg_RemountAttempts" );
rem_attempts_label->setBuddy( remount_attempts );
QLabel *rem_interval_label = new QLabel( Smb4KSettings::self()->remountIntervalItem()->label(),
mount_box );
- rem_interval_label->setIndent( 30 );
KIntNumInput *remount_interval = new KIntNumInput( mount_box );
remount_interval->setObjectName( "kcfg_RemountInterval" );
remount_interval->setSuffix( " min." );
rem_interval_label->setBuddy( remount_interval );
+
+ QCheckBox *remount_shares = new QCheckBox( Smb4KSettings::self()->remountSharesItem()->label(),
+ mount_box );
+ remount_shares->setObjectName( "kcfg_RemountShares" );
+
+ QCheckBox *unmount_all_shares = new QCheckBox( Smb4KSettings::self()->unmountSharesOnExitItem()->label(),
+ mount_box );
+ unmount_all_shares->setObjectName( "kcfg_UnmountSharesOnExit" );
QCheckBox *allow_foreign = new QCheckBox( Smb4KSettings::self()->unmountForeignSharesItem()->label(),
mount_box );
@@ -117,20 +114,20 @@ Smb4KShareOptionsPage::Smb4KShareOptionsPage( QWidget *parent )
#endif
#ifdef Q_OS_LINUX
- mount_layout->addWidget( remount_shares, 0, 0, 1, 2, 0 );
- mount_layout->addWidget( rem_attempts_label, 1, 0, 0 );
- mount_layout->addWidget( remount_attempts, 1, 1, 0 );
- mount_layout->addWidget( rem_interval_label, 2, 0, 0 );
- mount_layout->addWidget( remount_interval, 2, 1, 0 );
+ mount_layout->addWidget( rem_attempts_label, 0, 0, 0 );
+ mount_layout->addWidget( remount_attempts, 0, 1, 0 );
+ mount_layout->addWidget( rem_interval_label, 1, 0, 0 );
+ mount_layout->addWidget( remount_interval, 1, 1, 0 );
+ mount_layout->addWidget( remount_shares, 2, 0, 1, 2, 0 );
mount_layout->addWidget( unmount_all_shares, 3, 0, 1, 2, 0 );
mount_layout->addWidget( unmount_inaccessible, 4, 0, 1, 2, 0 );
mount_layout->addWidget( allow_foreign, 5, 0, 1, 2, 0 );
#else
- mount_layout->addWidget( remount_shares, 0, 0, 1, 2, 0 );
- mount_layout->addWidget( rem_attempts_label, 1, 0, 0 );
- mount_layout->addWidget( remount_attempts, 1, 1, 0 );
- mount_layout->addWidget( rem_interval_label, 2, 0, 0 );
- mount_layout->addWidget( remount_interval, 2, 1, 0 );
+ mount_layout->addWidget( rem_attempts_label, 0, 0, 0 );
+ mount_layout->addWidget( remount_attempts, 0, 1, 0 );
+ mount_layout->addWidget( rem_interval_label, 1, 0, 0 );
+ mount_layout->addWidget( remount_interval, 1, 1, 0 );
+ mount_layout->addWidget( remount_shares, 2, 0, 1, 2, 0 );
mount_layout->addWidget( unmount_all_shares, 3, 0, 1, 2, 0 );
mount_layout->addWidget( allow_foreign, 4, 0, 1, 2, 0 );
#endif