summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/advancedfm.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 23244a2..92804b2 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -66,69 +66,73 @@
AdvancedFm::AdvancedFm( )
: QMainWindow( ) {
init();
initConnections();
populateLocalView();
populateRemoteView();
currentPathCombo->setFocus();
}
AdvancedFm::~AdvancedFm() {
}
void AdvancedFm::cleanUp() {
QString sfile=QDir::homeDirPath();
if(sfile.right(1) != "/")
sfile+="/._temp";
else
sfile+="._temp";
QFile file( sfile);
if(file.exists())
file.remove();
}
-void AdvancedFm::tabChanged(QWidget *) {
- if (TabWidget->getCurrentTab() == 0) {
+void AdvancedFm::tabChanged(QWidget *w) {
+ qDebug("tab changed %d",TabWidget->getCurrentTab());
+
+ if ( w == tab) {
+// if (TabWidget->getCurrentTab() == 0) {
// if (TabWidget->currentPageIndex() == 0) {
- currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
- viewMenu->setItemChecked(viewMenu->idAt(0),TRUE);
- viewMenu->setItemChecked(viewMenu->idAt(1),FALSE);
- QString fs= getFileSystemType((const QString &) currentDir.canonicalPath());
- setCaption("AdvancedFm :: "+fs+" :: "
- +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" );
+ currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
+ viewMenu->setItemChecked(viewMenu->idAt(0),TRUE);
+ viewMenu->setItemChecked(viewMenu->idAt(1),FALSE);
+ QString fs= getFileSystemType((const QString &) currentDir.canonicalPath());
+ setCaption("AdvancedFm :: "+fs+" :: "
+ +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" );
- }
- if (TabWidget->getCurrentTab() == 1) {
+ }
+ if ( w == tab_2) {
+// if (TabWidget->getCurrentTab() == 1) {
// if (TabWidget->currentPageIndex() == 1) {
- currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath());
- viewMenu->setItemChecked(viewMenu->idAt(1),TRUE);
- viewMenu->setItemChecked(viewMenu->idAt(0),FALSE);
- QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
- setCaption("AdvancedFm :: "+fs+" :: "
- +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" );
- }
+ currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath());
+ viewMenu->setItemChecked(viewMenu->idAt(1),TRUE);
+ viewMenu->setItemChecked(viewMenu->idAt(0),FALSE);
+ QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
+ setCaption("AdvancedFm :: "+fs+" :: "
+ +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" );
+ }
}
void AdvancedFm::populateLocalView() {
QPixmap pm;
Local_View->clear();
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
currentDir.setMatchAllDirs(TRUE);
currentDir.setNameFilter(filterStr);
QString fileL, fileS, fileDate;
QString fs= getFileSystemType((const QString &) currentDir.canonicalPath());
setCaption("AdvancedFm :: "+fs+" :: "
+checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" );
bool isDir=FALSE;
const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ) {
QString symLink=fi->readLink();
QFileInfo sym( symLink);
fileS.sprintf( "%10i", sym.size() );
fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.filePath().data() );
fileDate = sym.lastModified().toString();