author | zecke <zecke> | 2004-03-23 00:36:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-23 00:36:37 (UTC) |
commit | d7581f7cd0ba6adb43ee5c4bdeae696c0a16ae3b (patch) (side-by-side diff) | |
tree | c65e9015323fb7fc4fec45038aa0f0a19b43252f | |
parent | 428b687982966dc2efabaf6dbcc55ad0ea30aa10 (diff) | |
download | opie-d7581f7cd0ba6adb43ee5c4bdeae696c0a16ae3b.zip opie-d7581f7cd0ba6adb43ee5c4bdeae696c0a16ae3b.tar.gz opie-d7581f7cd0ba6adb43ee5c4bdeae696c0a16ae3b.tar.bz2 |
Fix communication. It seems like QPixmap and QDataStream
do not mix well if the QPixmap is not valid..
invalidate image requests if we change the dir
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/lib/slavemaster.cpp | 7 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/slave/slavereciever.cpp | 7 |
3 files changed, 17 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 0b80012..38a621e 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -90,13 +90,13 @@ namespace { PIconView::PIconView( QWidget* wid, Config* cfg ) : QVBox( wid ), m_cfg( cfg ) { { - QCopEnvelope( "QPE/Application/opie-eye_slave", "foo()" ); +// QCopEnvelope( "QPE/Application/opie-eye_slave", "foo()" ); } m_path = QDir::homeDirPath(); QHBox *hbox = new QHBox( this ); QLabel* lbl = new QLabel( hbox ); lbl->setText( tr("View as" ) ); @@ -143,12 +143,16 @@ void PIconView::slotChangeDir(const QString& path) { m_path = lister->currentPath(); m_view->clear(); addFolders( lister->folders() ); addFiles( lister->files() ); + // Also invalidate the cache. We can't cancel the operations anyway + g_stringPix.clear(); + g_stringInf.clear(); + // looks ugly static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) ); } QString PIconView::currentFileName(bool &isDir)const { isDir = false; diff --git a/noncore/graphics/opie-eye/lib/slavemaster.cpp b/noncore/graphics/opie-eye/lib/slavemaster.cpp index 18dc883..4e28535 100644 --- a/noncore/graphics/opie-eye/lib/slavemaster.cpp +++ b/noncore/graphics/opie-eye/lib/slavemaster.cpp @@ -15,14 +15,19 @@ QDataStream & operator >> (QDataStream & str, bool & b) { Q_INT8 l; str >> l; b = bool(l); return str; } + +/* + * ! We don't put a Pixmap in!!!! + */ QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { - return s << inf.file << inf.pixmap << inf.width << inf.height; + qWarning( "Image request is %s %d %d", inf.file.latin1(), inf.width, inf.height ); + return s << inf.file << inf.width << inf.height; } QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { s >> inf.file >> inf.pixmap >> inf.width >> inf.height; return s; } QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { diff --git a/noncore/graphics/opie-eye/slave/slavereciever.cpp b/noncore/graphics/opie-eye/slave/slavereciever.cpp index 951f3df..c8e33d4 100644 --- a/noncore/graphics/opie-eye/slave/slavereciever.cpp +++ b/noncore/graphics/opie-eye/slave/slavereciever.cpp @@ -28,14 +28,19 @@ QDataStream & operator >> (QDataStream & str, bool & b) QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { return s << inf.file << inf.pixmap << inf.width << inf.height; } + +/* + * GUI sends no QPIxmap!!! + */ QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { - s >> inf.file >> inf.pixmap >> inf.width >> inf.height; + s >> inf.file >> inf.width >> inf.height; + qWarning( "Recieved %s %d %d", inf.file.latin1(), inf.width, inf.height ); return s; } QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { return s << i.kind << i.file << i.info; } QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { |