author | zecke <zecke> | 2002-11-03 11:03:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-03 11:03:20 (UTC) |
commit | 207f7430db6c90e88825ea2bedc9ae1bf68e3d99 (patch) (side-by-side diff) | |
tree | fb69b58f130c0b0a17224989f26aa4af5939b33e /libopie | |
parent | 485fae36510cb42690c9df55fae64312b1e656ae (diff) | |
download | opie-207f7430db6c90e88825ea2bedc9ae1bf68e3d99.zip opie-207f7430db6c90e88825ea2bedc9ae1bf68e3d99.tar.gz opie-207f7430db6c90e88825ea2bedc9ae1bf68e3d99.tar.bz2 |
Patch by Simon Hausmann to suit gcc3 needs
many thanks
-rw-r--r-- | libopie/oclickablelabel.cpp | 2 | ||||
-rw-r--r-- | libopie/ofileselector.cc | 9 | ||||
-rw-r--r-- | libopie/ofileselector.h | 2 | ||||
-rw-r--r-- | libopie/ofileselector/odefaultfactories.cpp | 4 | ||||
-rw-r--r-- | libopie/ofileselector/odefaultfactories.h | 1 | ||||
-rw-r--r-- | libopie/ofileselector/ofileselector.cpp | 3 | ||||
-rw-r--r-- | libopie/pim/opimaccessbackend.h | 4 | ||||
-rw-r--r-- | libopie/pim/opimaccesstemplate.h | 10 | ||||
-rw-r--r-- | libopie/pim/orecordlist.h | 4 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 2 |
10 files changed, 18 insertions, 23 deletions
diff --git a/libopie/oclickablelabel.cpp b/libopie/oclickablelabel.cpp index 43a0524..5768529 100644 --- a/libopie/oclickablelabel.cpp +++ b/libopie/oclickablelabel.cpp @@ -4,33 +4,33 @@ OClickableLabel::OClickableLabel(QWidget* parent, const char* name, WFlags fl) : QLabel(parent,name,fl) { textInverted=false; isToggle=false; isDown=false; showState(false); setFrameShadow(Sunken); } void OClickableLabel::setToggleButton(bool t) { isToggle=t; } -void OClickableLabel::mousePressEvent( QMouseEvent *e ) { +void OClickableLabel::mousePressEvent( QMouseEvent * /*e*/ ) { if (isToggle && isDown) { showState(false); } else { showState(true); } } void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { if (rect().contains(e->pos()) && isToggle) isDown=!isDown; if (isToggle && isDown) { showState(true); } else { showState(false); } diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index 9534667..6a6a300 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc @@ -362,33 +362,33 @@ QString OFileSelector::selectedPath()const return path; } QStringList OFileSelector::selectedPaths() const { QStringList list; list << selectedPath(); return list; } QString OFileSelector::directory()const { if( m_selector == NORMAL ) return QPEApplication::documentDir(); return QDir(m_currentDir).absPath(); } -int OFileSelector::fileCount() +int OFileSelector::fileCount() const { int count; switch( m_selector ){ case NORMAL: count = m_select->fileCount(); break; //case CUSTOM: case EXTENDED: case EXTENDED_ALL: default: count = m_View->childCount(); break; } return count; } DocLnk OFileSelector::selectedDocument() const @@ -669,65 +669,65 @@ void OFileSelector::initVars() m_pseudo = 0; m_pseudoLayout = 0; m_select = 0; m_stack = 0; m_lay = 0; m_Oselector = 0; m_boxToolbar = 0; m_boxOk = 0; m_boxName = 0; m_boxView = 0; m_custom = 0; m_edit = 0; m_fnLabel = 0; m_new = 0; m_close = 0; } -void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink) +void OFileSelector::addFile(const QString &/*mime*/, QFileInfo *info, bool symlink) { if(!m_files) return; // if( !compliesMime(info->absFilePath(), mime ) ) // return; MimeType type( info->absFilePath() ); if (!compliesMime( type.id() ) ) return; QPixmap pix = type.pixmap(); QString dir; QString name; bool locked; if( pix.isNull() ) pix = Resource::loadPixmap( "UnknownDocument-14"); dir = info->dirPath( true ); if( symlink ) name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); else { name = info->fileName(); if( ( m_mode == OPEN && !info->isReadable() )|| ( m_mode == SAVE && !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( m_selector == EXTENDED_ALL || m_selector == EXTENDED ){ 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 { // readable pix = symlink ? (*m_pixmaps)["dirsymlink"] : Resource::loadPixmap("folder") ; } @@ -1005,33 +1005,32 @@ bool OFileSelector::compliesMime( const QString& mime ) { }else if ( currentText.isEmpty() ) return true; else{ it = m_mimetypes.find(currentText ); if ( it == m_mimetypes.end() ) qWarning("not there"), list << currentText; else qWarning("found"), list = it.data(); } // dump it now //for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // qWarning( "%s", (*it).latin1() ); //} if ( list.contains(mime) ) return true; qWarning("list doesn't contain it "); QStringList::Iterator it2; int pos; - int pos2; for ( it2 = list.begin(); it2 != list.end(); ++it2 ) { pos = (*it2).findRev("/*"); if ( pos >= 0 ) { if ( mime.contains( (*it2).left(pos) ) ) return true; } } return false; } void OFileSelector::slotFileSelected( const QString &string ) { if( m_shLne ) m_edit->setText( string ); emit fileSelected( string ); } void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk ) { @@ -1092,33 +1091,33 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint & emit fileSelected( lnk ); } } break; } } } void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) { if( item == 0 ) return; if( button != Qt::RightButton ) return; slotContextMenu( item ); } -void OFileSelector::slotContextMenu( QListViewItem *item) +void OFileSelector::slotContextMenu( QListViewItem * /*item*/) { } void OFileSelector::slotChangedDir() { OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); if(sel->isDir() ){ QStringList str = QStringList::split("->", sel->text(1) ); cd( sel->directory() + "/" + str[0].stripWhiteSpace() ); } } void OFileSelector::slotOpen() { OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); if(!sel->isDir() ){ QStringList str = QStringList::split("->", sel->text(1) ); diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h index f2d5f84..17c494e 100644 --- a/libopie/ofileselector.h +++ b/libopie/ofileselector.h @@ -167,33 +167,33 @@ class OFileSelector : public QWidget { bool showPopup()const { return m_showPopup; }; void setShowPopup( bool pop ) { m_showPopup = pop; }; void setPopupMenu( QPopupMenu * ); // void updateLay(); void reparse(); // re reads the dir QString selectedName( )const; QStringList selectedNames()const; QString selectedPath() const; QStringList selectedPaths() const; QString directory()const; - int fileCount(); + int fileCount() const; /* the user needs to delete it */ DocLnk selectedDocument()const; /* the user needs to delete it */ QValueList<DocLnk> selectedDocuments()const; signals: void fileSelected( const DocLnk & ); void fileSelected( const QString & ); void dirSelected(const QString &dir ); void closeMe(); void ok(); void cancel(); void contextMenu(); private slots: diff --git a/libopie/ofileselector/odefaultfactories.cpp b/libopie/ofileselector/odefaultfactories.cpp index c8efffb..2f8ef9b 100644 --- a/libopie/ofileselector/odefaultfactories.cpp +++ b/libopie/ofileselector/odefaultfactories.cpp @@ -1,23 +1,19 @@ #include "ofilelistview.h" -#include "ofileiconview.h" #include "olocallister.h" #include "odefaultfactories.h" extern "C" { - OFileView* newFileIconView( OFileSelector* sel, QWidget* parent ) { - return new OFileIconView( parent, sel ); - } OFileView* newFileListView( OFileSelector* sel, QWidget* par ) { return new OFileListView(par, sel ); } OLister* newLocalLister( OFileSelector* sel) { return new OLocalLister( sel ); } }; diff --git a/libopie/ofileselector/odefaultfactories.h b/libopie/ofileselector/odefaultfactories.h index b4c35af..0cc90e5 100644 --- a/libopie/ofileselector/odefaultfactories.h +++ b/libopie/ofileselector/odefaultfactories.h @@ -1,17 +1,16 @@ #ifndef OPIE_DEFAULT_FACTORIES_H #define OPIE_DEFAULT_FACTORIES_H #include "ofilefactory.h" extern "C" { - OFileView* newFileIconView( OFileSelector*, QWidget* parent ); OFileView* newFileListView( OFileSelector*, QWidget* parent ); OLister* newLocalLister(OFileSelector* ); }; #endif diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp index c6e923f..abc2889 100644 --- a/libopie/ofileselector/ofileselector.cpp +++ b/libopie/ofileselector/ofileselector.cpp @@ -963,33 +963,34 @@ void OFileSelector::setView( const QString& lis ) { list = lis; m_selector = Extended; } setLister(m_listerName); m_fileView = factory()->view( list, this, m_mainView ); m_mainView->setWidget( m_fileView->widget() ); reparse(); } } /* * the factory */ void OFileSelector::initFactory() { m_fileFactory = new OFileFactory(); m_fileFactory->addLister(tr("Files"), newLocalLister ); m_fileFactory->addView(tr("List View"), newFileListView ); - m_fileFactory->addView(tr("Documents"), newFileIconView ); + /* dummy entry */ + m_fileFactory->addView(tr("Documents"), newFileListView ); } void OFileSelector::fillList() { qWarning("fill list"); if (!m_viewCheck ) return; m_viewCheck->clear(); QStringList list = factory()->views(); qWarning("views: " + list.join(";") ); for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { qWarning( (*it) ); if ( (*it) == tr("Documents") ) { m_viewCheck->insertItem( (*it) ); }else{ m_viewCheck->insertItem( (*it) ); diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h index 0bd2723..4f00bc9 100644 --- a/libopie/pim/opimaccessbackend.h +++ b/libopie/pim/opimaccessbackend.h @@ -44,33 +44,33 @@ public: */ virtual QArray<int> allRecords()const = 0; /** * queryByExample for T with the SortOrder * sort */ virtual QArray<int> queryByExample( const T& t, int sort ) = 0; /** * find the OPimRecord with uid @param uid * returns T and T.isEmpty() if nothing was found */ virtual T find(int uid )const = 0; virtual T find(int uid, const QArray<int>& items, - uint current, Frontend::CacheDirection )const ; + uint current, typename Frontend::CacheDirection )const ; /** * clear the back end */ virtual void clear() = 0; /** * add T */ virtual bool add( const T& t ) = 0; /** * remove */ virtual bool remove( int uid ) = 0; /** @@ -114,28 +114,28 @@ OPimAccessBackend<T>::~OPimAccessBackend() { template <class T> void OPimAccessBackend<T>::setFrontend( Frontend* fr ) { m_front = fr; } template <class T> void OPimAccessBackend<T>::cache( const T& t )const { if (m_front ) m_front->cache( t ); } template <class T> void OPimAccessBackend<T>::setSaneCacheSize( int size) { if (m_front ) m_front->setSaneCacheSize( size ); } template <class T> T OPimAccessBackend<T>::find( int uid, const QArray<int>&, - uint, Frontend::CacheDirection )const { + uint, typename Frontend::CacheDirection )const { return find( uid ); } template <class T> void OPimAccessBackend<T>::setReadAhead( uint count ) { m_read = count; } template <class T> uint OPimAccessBackend<T>::readAhead()const { return m_read; } #endif diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h index c5523a8..6de68b1 100644 --- a/libopie/pim/opimaccesstemplate.h +++ b/libopie/pim/opimaccesstemplate.h @@ -66,33 +66,33 @@ public: /** * queryByExample. * @see otodoaccess, ocontactaccess */ virtual List queryByExample( const T& t, int querySettings ); /** * find the OPimRecord uid */ virtual T find( int uid )const; /** * read ahead cache find method ;) */ virtual T find( int uid, const QArray<int>&, - uint current, CacheDirection dir = Forward )const; + uint current, typename OTemplateBase<T>::CacheDirection dir = OTemplateBase<T>::Forward )const; /* invalidate cache here */ /** * clears the backend and invalidates the backend */ virtual void clear() ; /** * add T to the backend * @param t The item to add. * @return <i>true</i> if added successfully. */ virtual bool add( const T& t ) ; /* only the uid matters */ /** @@ -152,54 +152,54 @@ OPimAccessTemplate<T>::~OPimAccessTemplate() { } template <class T> bool OPimAccessTemplate<T>::load() { invalidateCache(); return m_backEnd->load(); } template <class T> bool OPimAccessTemplate<T>::reload() { invalidateCache(); // zecke: I think this should be added (se) return m_backEnd->reload(); } template <class T> bool OPimAccessTemplate<T>::save() { return m_backEnd->save(); } template <class T> -OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { +typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { QArray<int> ints = m_backEnd->allRecords(); List lis(ints, this ); return lis; } template <class T> -OPimAccessTemplate<T>::List +typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); List lis(ints, this ); return lis; } template <class T> T OPimAccessTemplate<T>::find( int uid ) const{ T t = m_backEnd->find( uid ); cache( t ); return t; } template <class T> T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, - uint current, CacheDirection dir )const { + uint current, typename OTemplateBase<T>::CacheDirection dir )const { /* * better do T.isEmpty() * after a find this way we would * avoid two finds in QCache... */ // qWarning("find it now %d", uid ); if (m_cache.contains( uid ) ) { return m_cache.find( uid ); } T t = m_backEnd->find( uid, ar, current, dir ); cache( t ); return t; } template <class T> void OPimAccessTemplate<T>::clear() { @@ -217,33 +217,33 @@ bool OPimAccessTemplate<T>::remove( const T& t ) { } template <class T> bool OPimAccessTemplate<T>::remove( int uid ) { m_cache.remove( uid ); return m_backEnd->remove( uid ); } template <class T> bool OPimAccessTemplate<T>::replace( const T& t ) { m_cache.replace( t ); return m_backEnd->replace( t ); } template <class T> void OPimAccessTemplate<T>::invalidateCache() { m_cache.invalidate(); } template <class T> -OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { +typename OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { return m_backEnd; } template <class T> bool OPimAccessTemplate<T>::wasChangedExternally()const { return false; } template <class T> void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { m_backEnd = end; if (m_backEnd ) m_backEnd->setFrontend( this ); } template <class T> void OPimAccessTemplate<T>::cache( const T& t ) const{ /* hacky we need to work around the const*/ ((OPimAccessTemplate<T>*)this)->m_cache.add( t ); diff --git a/libopie/pim/orecordlist.h b/libopie/pim/orecordlist.h index 8ed41e2..b77a4ab 100644 --- a/libopie/pim/orecordlist.h +++ b/libopie/pim/orecordlist.h @@ -234,38 +234,38 @@ void ORecordListIterator<T>::setCurrent( uint cur ) { } template <class T> uint ORecordListIterator<T>::count()const { return m_uids.count(); } template <class T> ORecordList<T>::ORecordList( const QArray<int>& ids, const Base* acc ) : m_ids( ids ), m_acc( acc ) { } template <class T> ORecordList<T>::~ORecordList() { /* nothing to do here */ } template <class T> -ORecordList<T>::Iterator ORecordList<T>::begin() { +typename ORecordList<T>::Iterator ORecordList<T>::begin() { Iterator it( m_ids, m_acc ); return it; } template <class T> -ORecordList<T>::Iterator ORecordList<T>::end() { +typename ORecordList<T>::Iterator ORecordList<T>::end() { Iterator it( m_ids, m_acc ); it.m_end = true; it.m_current = m_ids.count(); return it; } template <class T> uint ORecordList<T>::count()const { return m_ids.count(); } template <class T> T ORecordList<T>::operator[]( uint i ) { if ( i < 0 || (i+1) > m_ids.count() ) return T(); /* forward */ return m_acc->find( m_ids[i], m_ids, i ); diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index 0d5b1d3..4d5cb79 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp @@ -386,20 +386,20 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { dest->date = src->date; dest->isCompleted = src->isCompleted; dest->hasDate = src->hasDate; dest->priority = src->priority; dest->desc = src->desc; dest->sum = src->sum; dest->extra = src->extra; dest->prog = src->prog; dest->hasAlarmDateTime = src->hasAlarmDateTime; dest->alarmDateTime = src->alarmDateTime; dest->state = src->state; dest->recur = src->recur; } QString OTodo::type() const { return QString::fromLatin1("OTodo"); } -QString OTodo::recordField(int id )const { +QString OTodo::recordField(int /*id*/ )const { return QString::null; } |