summaryrefslogtreecommitdiff
authorzecke <zecke>2004-04-06 10:37:23 (UTC)
committer zecke <zecke>2004-04-06 10:37:23 (UTC)
commit8981e35697647315d88cdf95e912b0fe2f9d5375 (patch) (side-by-side diff)
tree4631dc800cb6d45d38d69d43f14e305ce0123d10
parent2a4ec8132bea9c4c8308038d555755eabc1eee46 (diff)
downloadopie-8981e35697647315d88cdf95e912b0fe2f9d5375.zip
opie-8981e35697647315d88cdf95e912b0fe2f9d5375.tar.gz
opie-8981e35697647315d88cdf95e912b0fe2f9d5375.tar.bz2
Add some documentation and remove qWarnings
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 4ced52d..c07a1e5 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -200,9 +200,8 @@ void PIconView::initKeys() {
void PIconView::slotDirUp() {
QDir dir( m_path );
dir.cdUp();
slotChangeDir( dir.absPath() );
-
}
/*
* change the dir
@@ -214,13 +213,20 @@ void PIconView::slotChangeDir(const QString& path) {
PDirLister *lister = currentView()->dirLister();
if (!lister )
return;
+ /*
+ * Say what we want and take what we get
+ */
lister->setStartPath( path );
m_path = lister->currentPath();
m_view->viewport()->setUpdatesEnabled( false );
m_view->clear();
+
+ /*
+ * add files and folders
+ */
addFolders( lister->folders() );
addFiles( lister->files() );
m_view->viewport()->setUpdatesEnabled( true );
@@ -231,8 +237,12 @@ void PIconView::slotChangeDir(const QString& path) {
// looks ugly
static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) );
}
+/**
+ * get the current file name
+ * @param isDir see if this is a dir or real file
+ */
QString PIconView::currentFileName(bool &isDir)const {
isDir = false;
QIconViewItem* _it = m_view->currentItem();
if ( !_it )
@@ -257,8 +267,12 @@ void PIconView::slotTrash() {
currentView()->dirLister()->deleteImage( pa );
delete m_view->currentItem();
}
+
+/*
+ * see what views are available
+ */
void PIconView::loadViews() {
ViewMap::Iterator it;
ViewMap* map = viewMap();
for ( it = map->begin(); it != map->end(); ++it )
@@ -268,8 +282,11 @@ void PIconView::loadViews() {
void PIconView::resetView() {
slotViewChanged(m_views->currentItem());
}
+/*
+ *swicth view reloadDir and connect signals
+ */
void PIconView::slotViewChanged( int i) {
if (!m_views->count() ) {
setCurrentView( 0l);
return;
@@ -302,8 +319,11 @@ void PIconView::slotReloadDir() {
slotChangeDir( m_path );
}
+/*
+ * add files and folders
+ */
void PIconView::addFolders( const QStringList& lst) {
QStringList::ConstIterator it;
for(it=lst.begin(); it != lst.end(); ++it )
@@ -318,8 +338,11 @@ void PIconView::addFiles( const QStringList& lst) {
(void)new IconViewItem( m_view, m_path+"/"+(*it), (*it) );
}
+/*
+ * user clicked on the item. Change dir or view
+ */
void PIconView::slotClicked(QIconViewItem* _it) {
if(!_it )
return;
@@ -329,8 +352,12 @@ void PIconView::slotClicked(QIconViewItem* _it) {
else // view image
slotShowImage();
}
+/*
+ * got thumb info add to the cache if items is visible
+ * we later need update after processing of slave is done
+ */
void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
IconViewItem* item = g_stringInf[_path];
if (!item )
return;
@@ -341,8 +368,12 @@ void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
item->setText( str );
g_stringInf.remove( _path );
}
+
+/*
+ * got thumbnail and see if it is visible so we need to update later
+ */
void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) {
IconViewItem* item = g_stringPix[_path];
if (!item )
return;
@@ -358,12 +389,19 @@ void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) {
g_stringPix.remove( _path );
}
+/*
+ * FIXME rename
+ */
void PIconView::slotRename() {
}
+
+/*
+ * BEAM the current file
+ */
void PIconView::slotBeam() {
bool isDir;
QString pa = currentFileName( isDir );
if ( isDir && pa.isEmpty() )
@@ -375,8 +413,11 @@ void PIconView::slotBeam() {
ir->send(pa, tr( "Image" ) );
}
+/*
+ * BEAM done clean up
+ */
void PIconView::slotBeamDone( Ir* ir) {
delete ir;
}
@@ -392,9 +433,8 @@ void PIconView::slotEnd() {
}
void PIconView::slotShowImage()
{
- qWarning( "SLotShowImage" );
bool isDir = false;
QString name = currentFileName(isDir);
if (isDir) return;
@@ -403,9 +443,8 @@ void PIconView::slotShowImage()
void PIconView::slotShowImage( const QString& name) {
emit sig_display( name );
}
void PIconView::slotImageInfo() {
- qWarning( "SlotImageInfo" );
bool isDir = false;
QString name = currentFileName(isDir);
if (isDir) return;