summaryrefslogtreecommitdiffstats
path: root/filesharing
diff options
context:
space:
mode:
authorAndrew Randrianasulu <randrianasulu@gmail.com>2019-10-27 16:41:00 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-10-29 01:27:31 +0100
commit980c185af3ae231d7cd7ed282879d1d8403e1e08 (patch)
tree67a72d20139d4346a27a4936d8700f4f2c3a9a1d /filesharing
parent09c8a5af12fb62876f58bb50811f727e35e8f92b (diff)
downloadtdenetwork-980c185af3ae231d7cd7ed282879d1d8403e1e08.tar.gz
tdenetwork-980c185af3ae231d7cd7ed282879d1d8403e1e08.zip
Adding checking for Samba version 4 in kcm_sambaconf/sambafile.cpp
Fixes issue #15 in tdenetwork Signed-off-by: Andrew Randrianasulu <randrianasulu@gmail.com> Minor adjustments to refine the version test. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 23344311de3556b70c6604132450f7b319c1d38d)
Diffstat (limited to 'filesharing')
-rw-r--r--filesharing/advanced/kcm_sambaconf/sambafile.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/filesharing/advanced/kcm_sambaconf/sambafile.cpp b/filesharing/advanced/kcm_sambaconf/sambafile.cpp
index 7929b96d..a9eb26a5 100644
--- a/filesharing/advanced/kcm_sambaconf/sambafile.cpp
+++ b/filesharing/advanced/kcm_sambaconf/sambafile.cpp
@@ -350,12 +350,15 @@ int SambaFile::getSambaVersion() {
connect( &testParam, TQT_SIGNAL(receivedStdout(TDEProcess*,char*,int)),
this, TQT_SLOT(testParmStdOutReceived(TDEProcess*,char*,int)));
-
-
- if (testParam.start(TDEProcess::Block,TDEProcess::Stdout)) {
- if (_parmOutput.find("3") > -1)
+ if (testParam.start(TDEProcess::Block, TDEProcess::Stdout)) {
+ if (_parmOutput.find(" 3.") > -1) {
_sambaVersion = 3;
- }
+ }
+ if (_parmOutput.find(" 4.") > -1) {
+ _sambaVersion = 4;
+ }
+ }
+
kdDebug(5009) << "Samba version = " << _sambaVersion << endl;
@@ -373,7 +376,7 @@ SambaShare* SambaFile::getTestParmValues(bool reload)
testParam << "testparm";
testParam << "-s";
- if (getSambaVersion() == 3)
+ if ((getSambaVersion() == 3) || (getSambaVersion() == 4))
testParam << "-v";