summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2005-08-16 09:55:52 (UTC)
committer llornkcor <llornkcor>2005-08-16 09:55:52 (UTC)
commitdd4792fe0ac89205e7d7a7e38f3d4350e19f25d7 (patch) (unidiff)
tree4a9bcee8e558a66ab9ecd0c1c6337581821c9d95
parent8c44cc4fdb67ea6b96cf7e49ec648de4049a9f1c (diff)
downloadopie-dd4792fe0ac89205e7d7a7e38f3d4350e19f25d7.zip
opie-dd4792fe0ac89205e7d7a7e38f3d4350e19f25d7.tar.gz
opie-dd4792fe0ac89205e7d7a7e38f3d4350e19f25d7.tar.bz2
fix a few things
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opie-smb/qsmb.cpp19
-rw-r--r--noncore/net/opie-smb/qsmb.h4
2 files changed, 21 insertions, 2 deletions
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 )
44 connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt())); 44 connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt()));
45 connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked())); 45 connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked()));
46 connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear())); 46 connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear()));
47 connect(ListViewScan, SIGNAL(clicked(QListViewItem*)), this, SLOT(TextViewClicked(QListViewItem*)));
47 48
48 mountpt->setEditable(true); 49 mountpt->setEditable(true);
49 mountpt->insertItem("/mnt/samba1",-1); 50 mountpt->insertItem("/mnt/samba1",-1);
@@ -353,6 +354,12 @@ void Qsmb::DoIt()
353 354
354void Qsmb::umountIt() 355void Qsmb::umountIt()
355{ 356{
357 QListViewItem *element;
358 element = ListViewScan->selectedItem();
359 if(!element) {
360 return;
361 }
362
356 QString mount = mountpt->currentText(); 363 QString mount = mountpt->currentText();
357 if(!isMounted(mount)) { 364 if(!isMounted(mount)) {
358 qWarning(mount +" is not mounted"); 365 qWarning(mount +" is not mounted");
@@ -362,8 +369,6 @@ void Qsmb::umountIt()
362 369
363 QStringList ccmd; 370 QStringList ccmd;
364 QString share; 371 QString share;
365 QListViewItem *element;
366 element = ListViewScan->selectedItem();
367 share = element->text(0); 372 share = element->text(0);
368 qWarning("selected share is "+share); 373 qWarning("selected share is "+share);
369 374
@@ -435,3 +440,13 @@ QString Qsmb::getMount(const QString &shareName)
435 endmntent( mntfp ); 440 endmntent( mntfp );
436 return mount; 441 return mount;
437} 442}
443
444void Qsmb::TextViewClicked(QListViewItem* item)
445{
446 if(item == NULL) return;
447
448 QString text = item->text(2);
449 qWarning(text);
450 if( !text.isEmpty())
451 mountpt->insertItem(text,0);
452}
diff --git a/noncore/net/opie-smb/qsmb.h b/noncore/net/opie-smb/qsmb.h
index abf27da..175b2c3 100644
--- a/noncore/net/opie-smb/qsmb.h
+++ b/noncore/net/opie-smb/qsmb.h
@@ -10,6 +10,8 @@
10#include <qlistview.h> 10#include <qlistview.h>
11#include <pthread.h> 11#include <pthread.h>
12 12
13#include <qlistview.h>
14
13class Qsmb : public FormQPESMBBase 15class Qsmb : public FormQPESMBBase
14{ 16{
15 Q_OBJECT 17 Q_OBJECT
@@ -38,6 +40,8 @@ public slots:
38 QString out; 40 QString out;
39 bool runCommand(const QStringList &); 41 bool runCommand(const QStringList &);
40 42
43private slots:
44 void TextViewClicked(QListViewItem*);
41}; 45};
42void* runit(void *arg); 46void* runit(void *arg);
43void* runitm(void *arg); 47void* runitm(void *arg);