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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index c44d387..2ba3dca 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1,149 +1,149 @@
/***************************************************************************
AdvancedFm.cpp
-------------------
** Created: Sat Mar 9 23:33:09 2002
copyright : (C) 2002 by ljp
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#define DEVELOPERS_VERSION
#include "advancedfm.h"
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
#include <qpe/applnk.h>
#include <qpe/resource.h>
#include <qpe/menubutton.h>
#include <qcombobox.h>
#include <qpopupmenu.h>
#include <qlistview.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <sys/stat.h>
#include <time.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/vfs.h>
#include <mntent.h>
#ifdef NOQUICKLAUNCH
AdvancedFm::AdvancedFm( )
#else
AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
#endif
: QMainWindow( ) {
init();
renameBox = 0;
unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
initConnections();
whichTab=1;
rePopulate();
currentPathCombo->setFocus();
channel = new QCopChannel( "QPE/Application/advancedfm", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT( qcopReceive(const QCString&,const QByteArray&)) );
}
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 *) {
// qWarning("tab changed");
QString path = CurrentDir()->canonicalPath();
currentPathCombo->lineEdit()->setText( path );
if(whichTab == 1) {
viewMenu->setItemChecked(viewMenu->idAt(0), true);
viewMenu->setItemChecked(viewMenu->idAt(1), false);
} else {
viewMenu->setItemChecked(viewMenu->idAt(0), false);
viewMenu->setItemChecked(viewMenu->idAt(1), true);
}
QString fs= getFileSystemType( (const QString &) path);
setCaption(tr("AdvancedFm :: ")+fs+" :: "
+checkDiskSpace( (const QString &) path )+ tr(" kB free") );
chdir( path.latin1());
}
void AdvancedFm::populateView() {
// qWarning("PopulateView");
QPixmap pm;
QListView *thisView = CurrentView();
QDir *thisDir = CurrentDir();
QString path = thisDir->canonicalPath();
//qWarning("path is "+path);
thisView->clear();
thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
thisDir->setMatchAllDirs(TRUE);
thisDir->setNameFilter(filterStr);
QString fileL, fileS, fileDate;
QString fs= getFileSystemType((const QString &) path);
setCaption(tr("AdvancedFm :: ")+fs+" :: "
+checkDiskSpace((const QString &) path)+ tr(" kB free") );
bool isDir=FALSE;
const QFileInfoList *list = thisDir->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 = fi->fileName() +" -> " + sym.filePath().data();
fileDate = sym.lastModified().toString();
} else {
fileS.sprintf( "%10i", fi->size() );
fileL = fi->fileName();
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) {
// if(fileL == "..")
fileL += "/";
isDir=TRUE;
}
}
QFileInfo fileInfo( path + "/" + fileL);
if(fileL !="./" && fi->exists()) {
item = new QListViewItem( thisView, fileL, fileS , fileDate);
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable()) //is directory
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
}
else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
pm = Resource::loadPixmap( "exec");
}
else if( (fileInfo.permission( QFileInfo::ExeUser)
| fileInfo.permission( QFileInfo::ExeGroup)
| fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) {
pm = Resource::loadPixmap( "exec");
}