Commit 91bb58a4 authored by Alexander Reinholdt's avatar Alexander Reinholdt
Browse files

Introduce argument for Smb4KCustomOptions::hasOptions() to be able to filter out those options

that carry Smb4KCustomOptions::RemountOnce as only setting.
parent 14e9e83e
......@@ -2,7 +2,7 @@
This class carries custom options
-------------------
begin : Fr 29 Apr 2011
copyright : (C) 2011-2020 by Alexander Reinholdt
copyright : (C) 2011-2021 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
......@@ -847,15 +847,16 @@ QMap<QString, QString> Smb4KCustomOptions::customOptions() const
}
bool Smb4KCustomOptions::hasOptions() const
bool Smb4KCustomOptions::hasOptions(bool withoutRemountOnce) const
{
//
// NOTE: This function does not honor the workgroup, the url,
// the ip address, the type and the profile, because these things
// are not custom options.
//
// Perform persistent remounts
if (d->remount == Smb4KCustomOptions::RemountAlways)
// Perform remounts
if ((!withoutRemountOnce && d->remount != Smb4KCustomOptions::UndefinedRemount) || d->remount == Smb4KCustomOptions::RemountAlways)
{
return true;
}
......
......@@ -2,7 +2,7 @@
This class carries custom options
-------------------
begin : Fr 29 Apr 2011
copyright : (C) 2011-2020 by Alexander Reinholdt
copyright : (C) 2011-2021 by Alexander Reinholdt
email : alexander.reinholdt@kdemail.net
***************************************************************************/
......@@ -624,11 +624,12 @@ class Q_DECL_EXPORT Smb4KCustomOptions
QMap<QString,QString> customOptions() const;
/**
* Check if there are options defined
* Check if there are options defined. If @p withoutRemountOnce is set,
* this function will ignore the setting Smb4KCustomOptions::RemountOnce.
*
* @returns TRUE if there are options defined and FALSE otherwise
*/
bool hasOptions() const;
bool hasOptions(bool withoutRemountOnce = false) const;
/**
* Update this custom options object. You cannot change the workgroup,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment