From dd4792fe0ac89205e7d7a7e38f3d4350e19f25d7 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Tue, 16 Aug 2005 09:55:52 +0000 Subject: fix a few things --- (limited to 'noncore/net/opie-smb/qsmb.cpp') diff --git a/noncore/net/opie-smb/qsmb.cpp b/noncore/net/opie-smb/qsmb.cpp index 7f3ae89..d35e09a 100644 --- a/noncore/net/opie-smb/qsmb.cpp +++ b/noncore/net/opie-smb/qsmb.cpp @@ -44,6 +44,7 @@ Qsmb::Qsmb( QWidget* parent, const char* name, WFlags fl ) connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt())); connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked())); connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear())); + connect(ListViewScan, SIGNAL(clicked(QListViewItem*)), this, SLOT(TextViewClicked(QListViewItem*))); mountpt->setEditable(true); mountpt->insertItem("/mnt/samba1",-1); @@ -353,6 +354,12 @@ void Qsmb::DoIt() void Qsmb::umountIt() { + QListViewItem *element; + element = ListViewScan->selectedItem(); + if(!element) { + return; + } + QString mount = mountpt->currentText(); if(!isMounted(mount)) { qWarning(mount +" is not mounted"); @@ -362,8 +369,6 @@ void Qsmb::umountIt() QStringList ccmd; QString share; - QListViewItem *element; - element = ListViewScan->selectedItem(); share = element->text(0); qWarning("selected share is "+share); @@ -435,3 +440,13 @@ QString Qsmb::getMount(const QString &shareName) endmntent( mntfp ); return mount; } + +void Qsmb::TextViewClicked(QListViewItem* item) +{ + if(item == NULL) return; + + QString text = item->text(2); + qWarning(text); + if( !text.isEmpty()) + mountpt->insertItem(text,0); +} -- cgit v0.9.0.2