summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/libopie.control2
-rw-r--r--libopie/ofileselector.cc159
2 files changed, 80 insertions, 81 deletions
diff --git a/libopie/libopie.control b/libopie/libopie.control
index 80bd2fc..e5416bf 100644
--- a/libopie/libopie.control
+++ b/libopie/libopie.control
@@ -1,2 +1,2 @@
-Files: $QTDIR/lib/libopie.so.1.0.0 $QTDIR/lib/libopie.so.1.0 $QTDIR/lib/libopie.so.1
+Files: $QTDIR/lib/libopie.so.1.0.0 $QTDIR/lib/libopie.so.1.0 $QTDIR/lib/libopie.so.1 $QTDIR/pics/opie/*
Priority: optional
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index ea19143..cb18039 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -68,4 +68,4 @@ namespace {
if( str == box->text(i ) ){
- index= i;
- break;
+ index= i;
+ break;
}
@@ -79,3 +79,3 @@ namespace {
OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName,
- const QString &fileName, const QStringList &mimetypes ) : QWidget( wid )
+ const QString &fileName, const QStringList &mimetypes ) : QWidget( wid )
{
@@ -86,5 +86,5 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString
m_name = fileName;
- m_mimetypes = mimetypes;
- if( mimetypes.isEmpty() )
- m_autoMime = true;
+ m_mimetypes = mimetypes;
+// if( mimetypes.isEmpty() )
+// m_autoMime = true;
@@ -141,3 +141,3 @@ void OFileSelector::initPics()
QPixmap pm = Resource::loadPixmap( "folder" );
- QPixmap lnk = Resource::loadPixmap( "symlink" );
+ QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
QPainter painter( &pm );
@@ -420,4 +420,4 @@ void OFileSelector::reparse()
if(fi->extension() == QString::fromLatin1("desktop") ){
- ++it;
- continue;
+ ++it;
+ continue;
}
@@ -425,3 +425,3 @@ void OFileSelector::reparse()
if( !m_mimetypes.contains( type.id() ) )
- m_mimetypes.append( type.id() );
+ m_mimetypes.append( type.id() );
@@ -469,22 +469,22 @@ void OFileSelector::reparse()
for(int i=0; i<=4; i++ ){ // prepend from dos
- QFileInfo info( file );
- if( !info.exists() ){
- qWarning("does not exist" );
- addSymlink(currMime, fi, TRUE );
- break;
- }else if( info.isDir() ){
- qWarning("isDir" );
- addDir(currMime, fi, TRUE );
- break;
- }else if( info.isFile() ){
- qWarning("isFile" );
- addFile(currMime, fi, TRUE );
- break;
- }else if( info.isSymLink() ){
- file = info.dirPath(true)+ "/"+ info.readLink();
- qWarning("isSymlink again %s", file.latin1() );
- }else if( i == 4 ){ // just insert it and have the symlink symbol
- addSymlink(currMime, fi );
- qWarning("level too deep" );
- }
+ QFileInfo info( file );
+ if( !info.exists() ){
+ qWarning("does not exist" );
+ addSymlink(currMime, fi, TRUE );
+ break;
+ }else if( info.isDir() ){
+ qWarning("isDir" );
+ addDir(currMime, fi, TRUE );
+ break;
+ }else if( info.isFile() ){
+ qWarning("isFile" );
+ addFile(currMime, fi, TRUE );
+ break;
+ }else if( info.isSymLink() ){
+ file = info.dirPath(true)+ "/"+ info.readLink();
+ qWarning("isSymlink again %s", file.latin1() );
+ }else if( i == 4 ){ // just insert it and have the symlink symbol
+ addSymlink(currMime, fi );
+ qWarning("level too deep" );
+ }
}
@@ -538,5 +538,5 @@ void OFileSelector::initializeYes()
connect(m_ok, SIGNAL(clicked() ),
- this, SLOT(slotOk() ) );
+ this, SLOT(slotOk() ) );
connect(m_cancel, SIGNAL(clicked() ),
- this, SLOT(slotCancel() ) );
+ this, SLOT(slotCancel() ) );
@@ -550,5 +550,6 @@ void OFileSelector::initializeChooser()
m_boxView->addWidget(m_viewCheck, 0 );
- m_boxView->insertSpacing(1, 8 );
+ m_boxView->insertSpacing(2, 8 );
m_boxView->addWidget(m_mimeCheck, 0 );
m_lay->addLayout(m_boxView );
+ m_lay->insertSpacing( 4, 8);
@@ -558,14 +559,14 @@ void OFileSelector::initializeChooser()
- if(!m_autoMime )
- m_mimeCheck->insertItem(m_mimetypes.join("," ) );
- else{ // check
+// if(!m_autoMime )
+// m_mimeCheck->insertItem(m_mimetypes.join("," ) );
+// else{ // check
updateMimes();
m_mimeCheck->insertStringList( m_mimetypes );
- }
+// }
connect( m_viewCheck, SIGNAL(activated(const QString &) ),
- this, SLOT(slotViewCheck(const QString & ) ) );
+ this, SLOT(slotViewCheck(const QString & ) ) );
connect( m_mimeCheck, SIGNAL(activated(const QString &) ),
- this, SLOT(slotMimeCheck(const QString & ) ) );
+ this, SLOT(slotMimeCheck(const QString & ) ) );
}
@@ -575,3 +576,3 @@ void OFileSelector::slotMimeCheck(const QString &view ){
m_select = new FileSelector(view == "All" ? QString::null : view
- , m_stack, "fileselector", FALSE, FALSE );
+ , m_stack, "fileselector", FALSE, FALSE );
m_stack->addWidget( m_select, NORMAL );
@@ -599,3 +600,3 @@ void OFileSelector::slotViewCheck(const QString &view ){
//if(m_pseudoLayout!=0 )
-// delete m_pseudoLayout;
+// delete m_pseudoLayout;
}
@@ -612,3 +613,3 @@ void OFileSelector::slotViewCheck(const QString &view ){
m_select = new FileSelector( currMime == "All" ? QString::null : currMime,
- m_stack,"fileselector", FALSE, FALSE );
+ m_stack,"fileselector", FALSE, FALSE );
m_stack->addWidget( m_select, NORMAL );
@@ -696,4 +697,3 @@ void OFileSelector::initializeListView()
m_up = new QPushButton(Resource::loadIconSet("up"),"", m_pseudo,"cdUpButton");
- m_up->setMinimumSize( QSize( 20, 20 ) );
- m_up->setMaximumSize( QSize( 20, 20 ) );
+ m_up->setFixedSize( QSize( 20, 20 ) );
connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) );
@@ -702,4 +702,3 @@ void OFileSelector::initializeListView()
m_homeButton = new QPushButton(Resource::loadIconSet("home") , "", m_pseudo);
- m_homeButton->setMinimumSize( QSize( 20, 20 ) );
- m_homeButton->setMaximumSize( QSize( 20, 20 ) );
+ m_homeButton->setFixedSize( QSize( 20, 20 ) );
connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotHome() ) );
@@ -708,4 +707,3 @@ void OFileSelector::initializeListView()
m_docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"", m_pseudo,"docsButton");
- m_docButton->setMinimumSize( QSize( 20, 20 ) );
- m_docButton->setMaximumSize( QSize( 20, 20 ) );
+ m_docButton->setFixedSize( QSize( 20, 20 ) );
connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotDoc() ) );
@@ -741,6 +739,6 @@ void OFileSelector::initializeListView()
m_View->addColumn(" ");
- m_View->addColumn(tr("Name") );
- m_View->addColumn(tr("Size") );
+ m_View->addColumn(tr("Name"),135 );
+ m_View->addColumn(tr("Size"),-1 );
m_View->addColumn(tr("Date"), 60 );
- m_View->addColumn(tr("Mime Type") );
+ m_View->addColumn(tr("Mime Type"),-1 );
QHeader *header = m_View->header();
@@ -748,2 +746,3 @@ void OFileSelector::initializeListView()
m_View->setSorting(1 );
+ m_View->setAllColumnsShowFocus( TRUE);
// connect now
@@ -752,5 +751,5 @@ void OFileSelector::initializeListView()
connect(m_View, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint &, int) ),
- this, SLOT(slotClicked( int, QListViewItem *, const QPoint &, int) ) );
+ this, SLOT(slotClicked( int, QListViewItem *, const QPoint &, int) ) );
connect(m_View, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )),
- this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) );
+ this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) );
@@ -793,4 +792,4 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink )
if( !info->isReadable() ){
- locked = true;
- pix = Resource::loadPixmap("locked" );
+ locked = true;
+ pix = Resource::loadPixmap("locked" );
}
@@ -798,4 +797,4 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink )
if( !info->isWritable() ){
- locked = true;
- pix = Resource::loadPixmap("locked" );
+ locked = true;
+ pix = Resource::loadPixmap("locked" );
}
@@ -804,5 +803,5 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink )
new OFileSelectorItem( m_View, pix, name,
- info->lastModified().toString(),
- QString::number( info->size() ),
- dir, locked );
+ info->lastModified().toString(),
+ QString::number( info->size() ),
+ dir, locked );
}
@@ -820,5 +819,5 @@ void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
if( symlink ){
- pix = (*m_pixmaps)["symlinkedlocked"];
+ pix = (*m_pixmaps)["symlinkedlocked"];
}else{
- pix = Resource::loadPixmap("lockedfolder" );
+ pix = Resource::loadPixmap("lockedfolder" );
}
@@ -826,5 +825,5 @@ void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
if( symlink ){
- pix = (*m_pixmaps)["dirsymlink" ];
+ pix = (*m_pixmaps)["dirsymlink" ];
}else{
- pix = Resource::loadPixmap("folder" );
+ pix = Resource::loadPixmap("folder" );
}
@@ -840,4 +839,4 @@ void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
new OFileSelectorItem(m_View, pix,
- name, info->lastModified().toString(),
- QString::number(info->size() ),info->dirPath(true), locked, true );
+ name, info->lastModified().toString(),
+ QString::number(info->size() ),info->dirPath(true), locked, true );
@@ -880,4 +879,4 @@ void OFileSelector::slotCurrentChanged(QListViewItem *item )
if(m_shLne ){
- m_edit->setText(sel->text(1) );
- qWarning("setTexy" );
+ m_edit->setText(sel->text(1) );
+ qWarning("setTexy" );
}
@@ -904,9 +903,9 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
if(sel->isDir() ){
- cd( sel->directory() + "/" + str[0] );
+ cd( sel->directory() + "/" + str[0] );
}else{
- qWarning("file" );
- if(m_shLne )
- m_edit->setText(str[0] );
- emit fileSelected(str[0] );
- // emit DocLnk need to do it
+ qWarning("file" );
+ if(m_shLne )
+ m_edit->setText(str[0] );
+ emit fileSelected(str[0] );
+ // emit DocLnk need to do it
}
@@ -941,3 +940,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
connect(&up, SIGNAL(activated() ),
- this, SLOT(cdUP() ) );
+ this, SLOT(cdUP() ) );
@@ -949,3 +948,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
connect(&act, SIGNAL(activated() ),
- this, SLOT(slotChangedDir() ) );
+ this, SLOT(slotChangedDir() ) );
}else{
@@ -954,3 +953,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
connect(&act, SIGNAL(activated() ),
- this, SLOT(slotOpen() ) );
+ this, SLOT(slotOpen() ) );
}
@@ -960,3 +959,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
connect(&rescan, SIGNAL(activated() ),
- this, SLOT(slotRescan() ) );
+ this, SLOT(slotRescan() ) );
@@ -966,3 +965,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
connect(&rename, SIGNAL(activated() ),
- this, SLOT(slotRename() ) );
+ this, SLOT(slotRename() ) );
@@ -973,3 +972,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
connect(&delItem, SIGNAL(activated() ),
- this, SLOT(slotDelete() ) );
+ this, SLOT(slotDelete() ) );