"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/smb4kmounter.cpp" between
smb4k-3.0.70.tar.xz and smb4k-3.0.71.tar.xz

About: Smb4K is an advanced SMB/CIFS share (network neighborhood) browser for KDE and a frontend to the programs of the Samba software suite. Beta version.

smb4kmounter.cpp  (smb4k-3.0.70.tar.xz):smb4kmounter.cpp  (smb4k-3.0.71.tar.xz)
skipping to change at line 30 skipping to change at line 30
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,* * Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,*
* MA 02110-1335, USA * * MA 02110-1335, USA *
***************************************************************************/ ***************************************************************************/
// Application specific includes // Application specific includes
#include "smb4kmounter.h" #include "smb4kmounter.h"
#include "smb4kmounter_p.h" #include "smb4kmounter_p.h"
#include "smb4kauthinfo.h" #include "smb4kauthinfo.h"
#include "smb4kworkgroup.h"
#include "smb4kshare.h" #include "smb4kshare.h"
#include "smb4ksettings.h" #include "smb4ksettings.h"
#include "smb4khomesshareshandler.h" #include "smb4khomesshareshandler.h"
#include "smb4kwalletmanager.h" #include "smb4kwalletmanager.h"
#include "smb4knotification.h" #include "smb4knotification.h"
#include "smb4kbookmarkhandler.h" #include "smb4kbookmarkhandler.h"
#include "smb4kcustomoptionsmanager.h" #include "smb4kcustomoptionsmanager.h"
#include "smb4kcustomoptions.h" #include "smb4kcustomoptions.h"
#include "smb4kbookmark.h" #include "smb4kbookmark.h"
#include "smb4kprofilemanager.h" #include "smb4kprofilemanager.h"
skipping to change at line 1125 skipping to change at line 1126
} }
else else
{ {
Smb4KNotification::commandNotFound("mount.cifs"); Smb4KNotification::commandNotFound("mount.cifs");
return false; return false;
} }
// //
// Global and custom options // Global and custom options
// //
QMap<QString, QString> globalOptions = globalSambaOptions();
OptionsPtr options = Smb4KCustomOptionsManager::self()->findOptions(share); OptionsPtr options = Smb4KCustomOptionsManager::self()->findOptions(share);
// //
// Pass the remote file system port to the URL // Pass the remote file system port to the URL
// //
if (options) if (options)
{ {
if (options->useFileSystemPort()) if (options->useFileSystemPort())
{ {
share->setPort(options->fileSystemPort()); share->setPort(options->fileSystemPort());
skipping to change at line 1154 skipping to change at line 1154
} }
// //
// List of arguments passed via "-o ..." to the mount command // List of arguments passed via "-o ..." to the mount command
// //
QStringList argumentsList; QStringList argumentsList;
// //
// Workgroup or domain // Workgroup or domain
// //
if (!share->workgroupName().trimmed().isEmpty()) // Do not use this, if the domain is a DNS domain.
//
WorkgroupPtr workgroup = findWorkgroup(share->workgroupName());
if ((workgroup && !workgroup->dnsDiscovered()) && !share->workgroupName().trim
med().isEmpty())
{ {
argumentsList << QString("domain=%1").arg(KShell::quoteArg(share->workgroupN ame())); argumentsList << QString("domain=%1").arg(KShell::quoteArg(share->workgroupN ame()));
} }
// //
// Host IP address // Host IP address
// //
if (share->hasHostIpAddress()) if (share->hasHostIpAddress())
{ {
argumentsList << QString("ip=%1").arg(share->hostIpAddress()); argumentsList << QString("ip=%1").arg(share->hostIpAddress());
skipping to change at line 1194 skipping to change at line 1198
// //
if (options) if (options)
{ {
if (options->useFileSystemPort() && options->fileSystemPort() == 139) if (options->useFileSystemPort() && options->fileSystemPort() == 139)
{ {
// The client's NetBIOS name // The client's NetBIOS name
if (!Smb4KSettings::netBIOSName().isEmpty()) if (!Smb4KSettings::netBIOSName().isEmpty())
{ {
argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(Smb4KSet tings::netBIOSName())); argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(Smb4KSet tings::netBIOSName()));
} }
else if (!globalOptions["netbios name"].isEmpty()) else if (!machineNetbiosName().isEmpty())
{ {
argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(globalOp tions["netbios name"])); argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(machineN etbiosName()));
} }
// The server's NetBIOS name // The server's NetBIOS name
argumentsList << QString("servernetbiosname=%1").arg(KShell::quoteArg(shar e->hostName())); argumentsList << QString("servern=%1").arg(KShell::quoteArg(share->hostNam e()));
} }
} }
else else
{ {
if (Smb4KMountSettings::useRemoteFileSystemPort() && Smb4KMountSettings::rem oteFileSystemPort() == 139) if (Smb4KMountSettings::useRemoteFileSystemPort() && Smb4KMountSettings::rem oteFileSystemPort() == 139)
{ {
// The client's NetBIOS name // The client's NetBIOS name
if (!Smb4KSettings::netBIOSName().isEmpty()) if (!Smb4KSettings::netBIOSName().isEmpty())
{ {
argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(Smb4KSet tings::netBIOSName())); argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(Smb4KSet tings::netBIOSName()));
} }
else if (!globalOptions["netbios name"].isEmpty()) else if (!machineNetbiosName().isEmpty())
{ {
argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(globalOp tions["netbios name"])); argumentsList << QString("netbiosname=%1").arg(KShell::quoteArg(machineN etbiosName()));
} }
// The server's NetBIOS name // The server's NetBIOS name
argumentsList << QString("servernetbiosname=%1").arg(KShell::quoteArg(shar e->hostName())); argumentsList << QString("servern=%1").arg(KShell::quoteArg(share->hostNam e()));
} }
} }
// //
// CIFS Unix extensions support // CIFS Unix extensions support
// //
// This sets the uid, gid, file_mode and dir_mode arguments, if necessary. // This sets the uid, gid, file_mode and dir_mode arguments, if necessary.
// //
if (options) if (options)
{ {
skipping to change at line 1317 skipping to change at line 1321
// //
// Client character set // Client character set
// //
if (Smb4KMountSettings::useClientCharset()) if (Smb4KMountSettings::useClientCharset())
{ {
switch (Smb4KMountSettings::clientCharset()) switch (Smb4KMountSettings::clientCharset())
{ {
case Smb4KMountSettings::EnumClientCharset::default_charset: case Smb4KMountSettings::EnumClientCharset::default_charset:
{ {
if (!globalOptions["unix charset"].isEmpty())
{
argumentsList << QString("iocharset=%1").arg(globalOptions["unix chars
et"].toLower());
}
break; break;
} }
default: default:
{ {
argumentsList << QString("iocharset=%1").arg(Smb4KMountSettings::self()- >clientCharsetItem()->choices().value(Smb4KMountSettings::clientCharset()).label ); argumentsList << QString("iocharset=%1").arg(Smb4KMountSettings::self()- >clientCharsetItem()->choices().value(Smb4KMountSettings::clientCharset()).label );
break; break;
} }
} }
} }
skipping to change at line 1703 skipping to change at line 1702
if (!share->isHomesShare()) if (!share->isHomesShare())
{ {
map.insert("mh_url", share->url()); map.insert("mh_url", share->url());
} }
else else
{ {
map.insert("mh_url", share->homeUrl()); map.insert("mh_url", share->homeUrl());
map.insert("mh_homes_url", share->url()); map.insert("mh_homes_url", share->url());
} }
map.insert("mh_workgroup", share->workgroupName());
map.insert("mh_ip", share->hostIpAddress());
// //
// Location of the Kerberos ticket // Location of the Kerberos ticket
// //
// The path to the Kerberos ticket is stored - if it exists - in the // The path to the Kerberos ticket is stored - if it exists - in the
// KRB5CCNAME environment variable. By default, the ticket is located // KRB5CCNAME environment variable. By default, the ticket is located
// at /tmp/krb5cc_[uid]. So, if the environment variable does not exist, // at /tmp/krb5cc_[uid]. So, if the environment variable does not exist,
// but the cache file is there, try to use it. // but the cache file is there, try to use it.
// //
if (QProcessEnvironment::systemEnvironment().contains("KRB5CCNAME")) if (QProcessEnvironment::systemEnvironment().contains("KRB5CCNAME"))
{ {
skipping to change at line 1937 skipping to change at line 1933
if (!share->isHomesShare()) if (!share->isHomesShare())
{ {
map.insert("mh_url", share->url()); map.insert("mh_url", share->url());
} }
else else
{ {
map.insert("mh_url", share->homeUrl()); map.insert("mh_url", share->homeUrl());
map.insert("mh_homes_url", share->url()); map.insert("mh_homes_url", share->url());
} }
map.insert("mh_workgroup", share->workgroupName());
map.insert("mh_ip", share->hostIpAddress());
return true; return true;
} }
#else #else
// //
// Dummy // Dummy
// //
bool Smb4KMounter::fillMountActionArgs(const SharePtr &, QVariantMap&) bool Smb4KMounter::fillMountActionArgs(const SharePtr &, QVariantMap&)
{ {
qWarning() << "Smb4KMounter::fillMountActionArgs() is not implemented!"; qWarning() << "Smb4KMounter::fillMountActionArgs() is not implemented!";
qWarning() << "Mounting under this operating system is not supported..."; qWarning() << "Mounting under this operating system is not supported...";
 End of changes. 12 change blocks. 
20 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)