Version: (using KDE 4.2.0) Compiler: gcc (GCC) 4.2.1 20070719 [FreeBSD] OS: FreeBSD Installed from: FreeBSD Ports Under FreeBSD smb.conf is located (by default) under /usr/local/etc/smb.conf however KDE does not look there. Please see patch for proposed changes that add /usr/local/etc/smb.conf to the search paths.
Created attachment 30913 [details] The proposed patch The patch does change the basics of how the method works. Instead of a, rather, long series of else/if it is converted into a for loop. This should result in less source code and machine code...?
Comment on attachment 30913 [details] The proposed patch --- kdelibs/kio/kio/ksambashare.cpp 2009-02-03 15:24:57.000000000 +0200 +++ kdelibs/kio/kio/ksambashare.cpp 2009-02-03 15:21:32.000000000 +0200 @@ -72,34 +72,29 @@ { KConfig config(QLatin1String(FILESHARECONF)); const KConfigGroup group(&config, QString()); + const char *smbConfPath[] = { + "/etc/samba/smb.conf", + "/etc/smb.conf", + "/usr/local/etc/smb.conf", + "/usr/local/samba/lib/smb.conf", + "/usr/samba/lib/smb.conf", + "/usr/lib/smb.conf", + "/usr/local/lib/smb.conf", + NULL}; smbConf = group.readEntry("SMBCONF"); if ( QFile::exists(smbConf) ) return true; + + for(const char **smb = smbConfPath; *smb != NULL; ++smb) + if ( QFile::exists(*smb) ) { + smbConf = *smb; + return true; + } + + kDebug(7000) << "KSambaShare: Could not found smb.conf!"; + return false; - if ( QFile::exists("/etc/samba/smb.conf") ) - smbConf = "/etc/samba/smb.conf"; - else - if ( QFile::exists("/etc/smb.conf") ) - smbConf = "/etc/smb.conf"; - else - if ( QFile::exists("/usr/local/samba/lib/smb.conf") ) - smbConf = "/usr/local/samba/lib/smb.conf"; - else - if ( QFile::exists("/usr/samba/lib/smb.conf") ) - smbConf = "/usr/samba/lib/smb.conf"; - else - if ( QFile::exists("/usr/lib/smb.conf") ) - smbConf = "/usr/lib/smb.conf"; - else - if ( QFile::exists("/usr/local/lib/smb.conf") ) - smbConf = "/usr/local/lib/smb.conf"; - else { - kDebug(7000) << "KSambaShare: Could not found smb.conf!"; - return false; - } - - return true; }
SVN commit 920766 by darioandres: Added default location to smb.conf under FreeBSD Loop over the default locations instead of having lot of if/else blocks BUG: 183006 M +26 -26 ksambashare.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=920766
SVN commit 920768 by darioandres: Backport of SVN commit 920766 to 4.2 branch Added default location to smb.conf under FreeBSD Loop over the default locations instead of having lot of if/else blocks BUG: 183006 M +26 -26 ksambashare.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=920768
SVN commit 920789 by darioandres: Doing the things properly as suggested by Friedrich W. H. Kossebau CCBUG: 183006 M +24 -17 ksambashare.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=920789
SVN commit 920798 by darioandres: Backport of SVN commit 920789 to 4.2branch Doing the things properly as suggested by Friedrich W. H. Kossebau CCBUG: 183006 M +24 -17 ksambashare.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=920798