author | zecke <zecke> | 2002-04-27 23:12:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-27 23:12:20 (UTC) |
commit | a64cc0ad0574ae1e15c4965d2557c3e06cc3fd65 (patch) (side-by-side diff) | |
tree | 80a622e1e82e46a24dc5968b7b89180d4420476c | |
parent | db95cde435e507833f58111237f86cb9f9ac927a (diff) | |
download | opie-a64cc0ad0574ae1e15c4965d2557c3e06cc3fd65.zip opie-a64cc0ad0574ae1e15c4965d2557c3e06cc3fd65.tar.gz opie-a64cc0ad0574ae1e15c4965d2557c3e06cc3fd65.tar.bz2 |
compile it for Max
-rw-r--r-- | libopie/ofileselector.cc | 4 | ||||
-rw-r--r-- | libopie/ofileview.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index 0e508af..9cf3f36 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc @@ -830,215 +830,215 @@ void OFileSelector::initializeListView() m_View->setSorting(1 ); m_View->setAllColumnsShowFocus( TRUE); // connect now connect(m_View, SIGNAL(selectionChanged() ), this, SLOT(slotSelectionChanged() ) ); connect(m_View, SIGNAL(currentChanged(QListViewItem *) ), this, SLOT(slotCurrentChanged(QListViewItem * ) ) ); connect(m_View, SIGNAL(mouseButtonClicked(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 ) ) ); }; /* If a item is locked depends on the mode if we're in OPEN !isReadable is locked if we're in SAVE !isWriteable is locked */ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink ){ // qWarning("Add Files" ); if( !m_files ){ // qWarning("not mfiles" ); return; } MimeType type( info->filePath() ); QString name; QString dir; bool locked= false; if(mime == "All" ){ ; }else if( type.id() != mime ) { return; } QPixmap pix = type.pixmap(); if(pix.isNull() ) pix = Resource::loadPixmap( "UnknownDocument-14" ); dir = info->dirPath( true ); if( symlink ) { // check if the readLink is readable // do it right later name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); }else{ // keep track of the icons name = info->fileName(); if( m_mode == OPEN ){ if( !info->isReadable() ){ locked = true; pix = Resource::loadPixmap("locked" ); } }else if( m_mode == SAVE ){ if( !info->isWritable() ){ locked = true; pix = Resource::loadPixmap("locked" ); } } } new OFileSelectorItem( m_View, pix, name, info->lastModified().toString(), QString::number( info->size() ), dir, locked ); } -void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) +void OFileSelector::addDir(const QString &/*mime*/, QFileInfo *info, bool symlink ) { if(!m_dir ) return; //if( showDirs ) { bool locked=false; QString name; QPixmap pix; if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){ locked = true; if( symlink ){ pix = (*m_pixmaps)["symlinkedlocked"]; }else{ pix = Resource::loadPixmap("lockedfolder" ); } }else{ if( symlink ){ pix = (*m_pixmaps)["dirsymlink" ]; }else{ pix = Resource::loadPixmap("folder" ); } } if( symlink){ name = info->fileName()+ "->"+ info->dirPath(true) +"/" +info->readLink(); }else{ //if(info->isReadable() ) name = info->fileName(); } new OFileSelectorItem(m_View, pix, name, info->lastModified().toString(), QString::number(info->size() ),info->dirPath(true), locked, true ); } } void OFileSelector::setShowDirs(bool dir ) { m_dir = dir; reparse(); } void OFileSelector::slotFileSelected(const QString &string ) { if(m_shLne ) m_edit->setText( string ); emit fileSelected( string ); // do AppLnk stuff } void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk ) { slotFileSelected(lnk.name() ); emit fileSelected( lnk ); } void OFileSelector::slotSelectionChanged() // get the current items // fixme { qWarning("selection changed" ); } void OFileSelector::slotCurrentChanged(QListViewItem *item ) { // qWarning("current changed" ); if( item == 0 ) return; if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ OFileSelectorItem *sel = (OFileSelectorItem*)item; if(!sel->isDir() ){ // qWarning("is not dir" ); if(m_shLne ){ m_edit->setText(sel->text(1) ); // qWarning("setTexy" ); } } }else { qWarning("mode not extended" ); } } // either select or change dir -void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &point, int ) +void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &/*point*/, int ) { if( item == 0 ) return; if( button != Qt::LeftButton ) return; // qWarning("clicked" ); if(m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ // qWarning("inside" ); OFileSelectorItem *sel = (OFileSelectorItem*)item; if(!sel->isLocked() ){ // not locked either changedir or open QStringList str = QStringList::split("->", sel->text(1) ); if(sel->isDir() ){ 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 } } else { qWarning( "locked" ); } }; } void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) { if (item == 0 ) return; if( button != Qt::RightButton ) return; // qWarning("right button" ); slotContextMenu(item); } void OFileSelector::slotContextMenu(QListViewItem *item) { // qWarning("context menu" ); if( item ==0 || !m_showPopup ) return; if( m_custom !=0){ m_custom->exec(); }else{ QPopupMenu menu; QAction up; up.setText("cd up"); up.addTo( &menu ); connect(&up, SIGNAL(activated() ), this, SLOT(cdUP() ) ); QAction act; OFileSelectorItem *sel = (OFileSelectorItem*)item; if(sel->isDir() ){ act.setText( tr("Change Directory") ); act.addTo(&menu ); connect(&act, SIGNAL(activated() ), this, SLOT(slotChangedDir() ) ); }else{ act.setText( tr("Open file" ) ); diff --git a/libopie/ofileview.h b/libopie/ofileview.h index 48a71ca..ed256f1 100644 --- a/libopie/ofileview.h +++ b/libopie/ofileview.h @@ -1,79 +1,79 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2002 zecke <zecke@handhelds.org> .>+-= _;:, .> :=|. This library is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This library is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ofileview_h #define ofileview_h #include <qobject.h> #include <qwidget.h> class QFileInfo; class QDir; class DocLnk; class OFileSelectorView : public QWidget { Q_OBJECT public: OFileSelectorView(QWidget *widget, const char *name ) : QWidget(widget, name ) { }; - virtual ~OFileSelectorView(); + virtual ~OFileSelectorView() = 0; virtual void addFile(const QString &mine, QFileInfo *info, bool isSymlink = FALSE ) = 0; virtual void addDir (const QString &mine, QFileInfo *info, bool isSymlink = FALSE ) = 0; virtual void addSymlink(const QString &mime, QFileInfo *info, bool isSymlink = FALSE ) = 0; - virtual void cd(const QString &path ); + virtual void cd(const QString &path ) = 0; signals: void fileSelected(const QString &); void fileSelected(const DocLnk & ); void contextMenu(); void changedDir(const QString &); void changedDir(const QDir & ); }; class OFileViewFactory { // Q_OBJECT public: OFileViewFactory() {} ; - virtual ~OFileViewFactory(); + virtual ~OFileViewFactory() = 0; OFileSelectorView* newView(QWidget *parent, const char *name ); QString name()const; }; #endif |