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.cpp57
1 files changed, 22 insertions, 35 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index a47edd8..afb44f5 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -34,13 +34,9 @@
#include <mntent.h>
using namespace Opie::Ui;
-#ifdef NOQUICKLAUNCH
-AdvancedFm::AdvancedFm( )
-#else
AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
-#endif
: QMainWindow( ) {
init();
renameBox = 0;
@@ -70,9 +66,9 @@ void AdvancedFm::cleanUp() {
file.remove();
}
void AdvancedFm::tabChanged(QWidget *) {
-// owarn << "tab changed" << oendl;
+// owarn << "tab changed" << oendl;
QString path = CurrentDir()->canonicalPath();
currentPathCombo->lineEdit()->setText( path );
if(whichTab == 1) {
@@ -92,15 +88,15 @@ void AdvancedFm::tabChanged(QWidget *) {
void AdvancedFm::populateView() {
-// owarn << "PopulateView" << oendl;
+// owarn << "PopulateView" << oendl;
QPixmap pm;
QListView *thisView = CurrentView();
QDir *thisDir = CurrentDir();
QString path = thisDir->canonicalPath();
-//owarn << "path is "+path << oendl;
+//owarn << "path is "+path << oendl;
thisView->clear();
thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
thisDir->setMatchAllDirs(TRUE);
thisDir->setNameFilter(filterStr);
@@ -159,9 +155,9 @@ void AdvancedFm::populateView() {
pm = unknownXpm;
}
}
if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) {
- // odebug << " overlay link image" << oendl;
+ // odebug << " overlay link image" << oendl;
pm= Resource::loadPixmap( "advancedfm/symlink" );
// pm= Resource::loadPixmap( "folder" );
// QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
// QPainter painter( &pm );
@@ -183,9 +179,9 @@ void AdvancedFm::populateView() {
if((dir = opendir( path.latin1())) != NULL)
while ((mydirent = readdir(dir)) != NULL) {
lstat( mydirent->d_name, &buf);
-// odebug << mydirent->d_name << oendl;
+// odebug << mydirent->d_name << oendl;
fileL.sprintf("%s", mydirent->d_name);
devT = buf.st_dev;
fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
fileDate.sprintf("%s", ctime( &buf.st_mtime));
@@ -208,9 +204,9 @@ void AdvancedFm::rePopulate() {
setOtherTabCurrent();
populateView();
// int tmpTab = whichTab;
-// // odebug << "" << tmpTab << "" << oendl;
+// // odebug << "" << tmpTab << "" << oendl;
// for(int i =1; i < 3; i++) {
// TabWidget->setCurrentWidget(i - 1);
// populateView();
@@ -218,12 +214,12 @@ void AdvancedFm::rePopulate() {
// TabWidget->setCurrentWidget( tmpTab - 1);
}
void AdvancedFm::ListClicked(QListViewItem *selectedItem) {
-//owarn << "listclicked" << oendl;
+//owarn << "listclicked" << oendl;
if(selectedItem) {
QString strItem=selectedItem->text(0);
-// owarn << strItem << oendl;
+// owarn << strItem << oendl;
QString strSize=selectedItem->text(1);
strSize=strSize.stripWhiteSpace();
bool isDirectory = false;
QString strItem2;
@@ -258,23 +254,20 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in
cancelRename();
}
}
break;
- case 2:
- menuTimer.start( 500, TRUE );
- break;
};
}
void AdvancedFm::switchToLocalTab() {
-//owarn << "switch to local view" << oendl;
+//owarn << "switch to local view" << oendl;
TabWidget->setCurrentWidget(0);
Local_View->setFocus();
}
void AdvancedFm::switchToRemoteTab() {
-//owarn << "switch to local view" << oendl;
+//owarn << "switch to local view" << oendl;
TabWidget->setCurrentWidget(1);
Remote_View->setFocus();
}
@@ -328,9 +321,9 @@ QStringList AdvancedFm::getPath() {
QListViewItemIterator it( thisView );
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {
strList << it.current()->text(0);
-// odebug << it.current()->text(0) << oendl;
+// odebug << it.current()->text(0) << oendl;
}
}
return strList;
}
@@ -379,9 +372,9 @@ void AdvancedFm::doAbout() {
"and is licensed by the GPL"));
}
void AdvancedFm::keyPressEvent( QKeyEvent *e) {
-// owarn << "key " << e->key() << "" << oendl;
+// owarn << "key " << e->key() << "" << oendl;
// if( CurrentView()->hasFocus() )
{
switch ( e->key() ) {
case Key_Left:
@@ -605,14 +598,8 @@ void AdvancedFm::showFileMenu() {
if(m) delete m;
}
-void AdvancedFm::cancelMenuTimer() {
-
- if( menuTimer.isActive() )
- menuTimer.stop();
-}
-
QString AdvancedFm::checkDiskSpace(const QString &path) {
struct statfs fss;
if ( !statfs( path.latin1(), &fss ) ) {
int blkSize = fss.f_bsize;
@@ -637,9 +624,9 @@ void AdvancedFm::addToDocs() {
if( strListPaths.count() > 0) {
QString curFile;
for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) {
curFile = thisDir->canonicalPath()+"/"+(*it);
-// odebug << curFile << oendl;
+// odebug << curFile << oendl;
QFileInfo fi(curFile);
DocLnk f;
// curFile.replace(QRegExp("\\..*"),"");
f.setName(fi.baseName() );
@@ -710,9 +697,9 @@ void AdvancedFm::addCustomDir() {
cfg.write();
}
void AdvancedFm::removeCustomDir() {
-// odebug << "remove custom dir" << oendl;
+// odebug << "remove custom dir" << oendl;
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QString dir;
QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
@@ -745,9 +732,9 @@ void AdvancedFm::removeCustomDir() {
}
void AdvancedFm::gotoCustomDir(const QString &dir) {
-// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl;
+// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl;
// QString curDir = dir;
// QDir *thisDir = CurrentDir();
// if( curDir.isEmpty()) {
// }
@@ -786,12 +773,12 @@ QDir *AdvancedFm::OtherDir() {
}
QListView * AdvancedFm::CurrentView() {
if ( whichTab == 1) {
-// owarn << "CurrentView Tab 1" << oendl;
+// owarn << "CurrentView Tab 1" << oendl;
return Local_View;
} else {
-// owarn << "CurrentView Tab 2" << oendl;
+// owarn << "CurrentView Tab 2" << oendl;
return Remote_View;
}
}
@@ -802,9 +789,9 @@ QListView * AdvancedFm::OtherView() {
return Local_View;
}
void AdvancedFm::setOtherTabCurrent() {
-// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl;
+// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl;
if ( whichTab == 1) {
TabWidget->setCurrentWidget(1);
} else {
TabWidget->setCurrentWidget(0);
@@ -813,12 +800,12 @@ void AdvancedFm::setOtherTabCurrent() {
OtherView()->setSelected( CurrentView()->firstChild(), true);
}
void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
-// odebug << "qcop message "+msg << oendl;
+// odebug << "qcop message "+msg << oendl;
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "openDirectory(QString)" ) {
-// odebug << "received" << oendl;
+// odebug << "received" << oendl;
QString file;
stream >> file;
gotoDirectory( (const QString &) file);
}
@@ -829,9 +816,9 @@ void AdvancedFm::setDocument(const QString &file) {
}
void AdvancedFm::gotoDirectory(const QString &file) {
-// owarn << "goto dir "+file << oendl;
+// owarn << "goto dir "+file << oendl;
QString curDir = file;
QDir *thisDir = CurrentDir();
if(QDir( curDir).exists() ) {
thisDir->setPath( curDir );
@@ -865,9 +852,9 @@ void AdvancedFm::findFile(const QString &fileName) {
}
}
void AdvancedFm::slotSwitchMenu(int ) {
-// odebug << "Switch " << item << "" << oendl;
+// odebug << "Switch " << item << "" << oendl;
// viewMenu->setItemChecked(item, true);
}
void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) {