Diffstat (limited to 'noncore/net/opie-smb/qsmb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opie-smb/qsmb.cpp | 19 |
1 files changed, 17 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 | ||
354 | void Qsmb::umountIt() | 355 | void 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 | |||
444 | void 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 | } | ||