From 865f314dd5ed55508f45a32973b709b79a541e36 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 11 Dec 2009 03:46:01 +0000 Subject: kdelibs update to Trinity v3.5.11 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1061230 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdeprint/management/smbview.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'kdeprint/management/smbview.cpp') diff --git a/kdeprint/management/smbview.cpp b/kdeprint/management/smbview.cpp index 79e088209..6cf5ee4c8 100644 --- a/kdeprint/management/smbview.cpp +++ b/kdeprint/management/smbview.cpp @@ -179,11 +179,8 @@ void SmbView::setOpen(QListViewItem *item, bool on) m_current = item; *m_proc << "nmblookup"+m_wins_server+"-M "; *m_proc << KProcess::quote(item->text(0)); - *m_proc << " -S | grep '<20>' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*<20>.*//' | xargs -Iserv_name smbclient -N -L 'serv_name' -W "; - *m_proc << KProcess::quote(item->text(0)); - *m_proc << " -A "; - *m_proc << KProcess::quote(m_passwdFile->name()); - startProcess(ServerListing); + *m_proc << " -S"; + startProcess(ServerListing); } else if (item->depth() == 1) { // opening server @@ -192,8 +189,11 @@ void SmbView::setOpen(QListViewItem *item, bool on) *m_proc << KProcess::quote(item->text(0)); *m_proc << " -W "; *m_proc << KProcess::quote(item->parent()->text(0)); - *m_proc << " -A "; - *m_proc << KProcess::quote(m_passwdFile->name()); + if (m_login != QString::null) + { + *m_proc << " -A "; + *m_proc << KProcess::quote(m_passwdFile->name()); + } startProcess(ShareListing); } } @@ -220,16 +220,14 @@ void SmbView::processServers() QStringList lines = QStringList::split('\n',m_buffer,true); QString line; uint index(0); - for (;index < lines.count();index++) - if (lines[index].stripWhiteSpace().startsWith("Server")) - break; - index += 2; while (index < lines.count()) { line = lines[index++].stripWhiteSpace(); if (line.isEmpty()) break; QStringList words = QStringList::split(' ',line,false); + if (words[1] != "<00>" || words[3] == "") + continue; QListViewItem *item = new QListViewItem(m_current,words[0]); item->setExpandable(true); item->setPixmap(0,SmallIcon("kdeprint_computer")); -- cgit v1.2.1