summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-22 12:16:36 (UTC)
committer llornkcor <llornkcor>2002-04-22 12:16:36 (UTC)
commitc4cbc0428d013fdd3fc5744edc416669d5564ade (patch) (side-by-side diff)
treebec11f4abf32164731bb16e6544e6a2586f146cb
parente79c930fb498f2bc3387da7133a57cd085244346 (diff)
downloadopie-c4cbc0428d013fdd3fc5744edc416669d5564ade.zip
opie-c4cbc0428d013fdd3fc5744edc416669d5564ade.tar.gz
opie-c4cbc0428d013fdd3fc5744edc416669d5564ade.tar.bz2
bug fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index fed15b4..1083f23 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -130,61 +130,61 @@ AdvancedFm::AdvancedFm( )
viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
viewMenu->insertSeparator();
viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
viewMenu->setCheckable(TRUE);
TabWidget = new QTabWidget( this, "TabWidget" );
layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6);
tab = new QWidget( TabWidget, "tab" );
tabLayout = new QGridLayout( tab );
tabLayout->setSpacing( 2);
tabLayout->setMargin( 2);
Local_View = new QListView( tab, "Local_View" );
// Local_View->setResizePolicy( QListView::AutoOneFit );
- Local_View->addColumn( tr("File"),140);
- Local_View->addColumn( tr("Date"),-1);
- Local_View->setColumnAlignment(1,QListView::AlignRight);
+ Local_View->addColumn( tr("File"),130);
Local_View->addColumn( tr("Size"),-1);
+ Local_View->setColumnAlignment(1,QListView::AlignRight);
+ Local_View->addColumn( tr("Date"),-1);
Local_View->setColumnAlignment(2,QListView::AlignRight);
Local_View->setAllColumnsShowFocus(TRUE);
// Local_View->setMultiSelection( TRUE );
// Local_View->setSelectionMode(QListView::Extended);
QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
tabLayout->addWidget( Local_View, 0, 0 );
connect( Local_View, SIGNAL( clicked( QListViewItem*)),
this,SLOT( localListClicked(QListViewItem *)) );
connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) );
TabWidget->insertTab( tab, tr("1"));
tab_2 = new QWidget( TabWidget, "tab_2" );
tabLayout_2 = new QGridLayout( tab_2 );
tabLayout_2->setSpacing( 2);
tabLayout_2->setMargin( 2);
Remote_View = new QListView( tab_2, "Remote_View" );
- Remote_View->addColumn( tr("File"),140);
- Remote_View->addColumn( tr("Date"),-1);
- Remote_View->setColumnAlignment(1,QListView::AlignRight);
+ Remote_View->addColumn( tr("File"),130);
Remote_View->addColumn( tr("Size"),-1);
+ Remote_View->setColumnAlignment(1,QListView::AlignRight);
+ Remote_View->addColumn( tr("Date"),-1);
Remote_View->setColumnAlignment(2,QListView::AlignRight);
Remote_View->setAllColumnsShowFocus(TRUE);
// Remote_View->setMultiSelection( TRUE );
// Remote_View->setSelectionMode(QListView::Extended);
QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
connect( Remote_View, SIGNAL( clicked( QListViewItem*)),
this,SLOT( remoteListClicked(QListViewItem *)) );
connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) );
tabLayout_2->addWidget( Remote_View, 0, 0 );
TabWidget->insertTab( tab_2, tr( "2"));
connect(TabWidget,SIGNAL(currentChanged(QWidget *)),
@@ -288,33 +288,33 @@ void AdvancedFm::populateLocalView()
// qDebug("Symlink detected "+symLink);
QFileInfo sym( symLink);
fileS.sprintf( "%10li", sym.size() );
fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
fileDate = sym.lastModified().toString();
} else {
fileS.sprintf( "%10li", fi->size() );
fileL.sprintf( "%s",fi->fileName().data() );
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
isDir=TRUE;
// qDebug( fileL);
}
}
if(fileL !="./" && fi->exists()) {
- item= new QListViewItem( Local_View, fileL , fileDate, fileS);
+ item= new QListViewItem( Local_View, fileL, fileS , fileDate);
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable())
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
item->setPixmap( 0,pm );
} else {
if( !fi->isReadable() )
pm = Resource::loadPixmap( "locked" );
else {
MimeType mt(fi->filePath());
pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
item->setPixmap( 0,pm);
@@ -341,33 +341,33 @@ void AdvancedFm::populateLocalView()
DIR *dir;
int fd = 0;
struct dirent *mydirent;
int i = 1;
if((dir = opendir( currentDir.canonicalPath().latin1())) != NULL)
while ((mydirent = readdir(dir)) != NULL) {
lstat( mydirent->d_name, &buf);
qDebug(mydirent->d_name);
// mode = buf.st_mode;
fileL.sprintf("%s", mydirent->d_name);
// fileS.sprintf("%d, %d", ); //this isn't correct
devT = buf.st_dev;
fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
// fileS.sprintf("%d,%d", devT, devT);
fileDate.sprintf("%s", ctime( &buf.st_mtime));
if( fileL.find(".") == -1 ){
- item= new QListViewItem( Local_View, fileL, fileDate, fileS);
+ item= new QListViewItem( Local_View, fileL, fileS, fileDate);
pm = Resource::loadPixmap( "UnknownDocument-14" );
item->setPixmap( 0,pm);
}
}
closedir(dir);
}
Local_View->setSorting( 3,FALSE);
fillCombo( (const QString &) currentDir.canonicalPath());
}
void AdvancedFm::populateRemoteView()
{
// QList<QListViewItem> * getSelectedItems( QListView * Local_View );
// QListViewItemIterator it( Remote_View );
@@ -395,33 +395,33 @@ void AdvancedFm::populateRemoteView()
QFileInfo sym( symLink);
fileS.sprintf( "%10li", sym.size() );
fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
fileDate = sym.lastModified().toString();
} else {
// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
fileS.sprintf( "%10li", fi->size() );
fileL.sprintf( "%s",fi->fileName().data() );
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
isDir=TRUE;
// qDebug( fileL);
}
}
if(fileL !="./" && fi->exists()) {
- item= new QListViewItem( Remote_View, fileL, fileDate, fileS);
+ item= new QListViewItem( Remote_View, fileL, fileS, fileDate);
QPixmap pm;
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable())
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
item->setPixmap( 0,pm );
} else {
if( !fi->isReadable() )
pm = Resource::loadPixmap( "locked" );
else {
MimeType mt(fi->filePath());
pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
@@ -446,33 +446,33 @@ void AdvancedFm::populateRemoteView()
struct stat st;
mode_t mode;
DIR *dir;
int fd = 0;
struct dirent *mydirent;
int i = 1;
if((dir = opendir( currentRemoteDir.canonicalPath().latin1())) != NULL)
while ((mydirent = readdir(dir)) != NULL) {
lstat( mydirent->d_name, &buf);
qDebug(mydirent->d_name);
// mode = buf.st_mode;
fileL.sprintf("%s", mydirent->d_name);
// fileS.sprintf("%d, %d", ); //this isn't correct
fileS.sprintf("%d,%d", (int) (buf.st_dev>>8)&0xFF, (int) buf.st_dev &0xFF);
fileDate.sprintf("%s", ctime( &buf.st_mtime));
if( fileL.find(".") == -1 ){
- item= new QListViewItem( Remote_View, fileL, fileDate, fileS);
+ item= new QListViewItem( Remote_View, fileL, fileS, fileDate);
pm = Resource::loadPixmap( "UnknownDocument-14" );
item->setPixmap( 0,pm);
}
}
closedir(dir);
}
Remote_View->setSorting( 3,FALSE);
fillCombo( (const QString &) currentRemoteDir.canonicalPath() );
}
void AdvancedFm::localListClicked(QListViewItem *selectedItem)
{
if(selectedItem) {
QString strItem=selectedItem->text(0);