author | zecke <zecke> | 2004-03-23 00:36:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-23 00:36:37 (UTC) |
commit | d7581f7cd0ba6adb43ee5c4bdeae696c0a16ae3b (patch) (unidiff) | |
tree | c65e9015323fb7fc4fec45038aa0f0a19b43252f /noncore | |
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 | |||
@@ -84,25 +84,25 @@ namespace { | |||
84 | inline void IconViewItem::setText( const QString& str ) { | 84 | inline void IconViewItem::setText( const QString& str ) { |
85 | QString text = QIconViewItem::text()+"\n"+str; | 85 | QString text = QIconViewItem::text()+"\n"+str; |
86 | m_noInfo = true; | 86 | m_noInfo = true; |
87 | QIconViewItem::setText( text ); | 87 | QIconViewItem::setText( text ); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | PIconView::PIconView( QWidget* wid, Config* cfg ) | 92 | PIconView::PIconView( QWidget* wid, Config* cfg ) |
93 | : QVBox( wid ), m_cfg( cfg ) | 93 | : QVBox( wid ), m_cfg( cfg ) |
94 | { | 94 | { |
95 | { | 95 | { |
96 | QCopEnvelope( "QPE/Application/opie-eye_slave", "foo()" ); | 96 | // QCopEnvelope( "QPE/Application/opie-eye_slave", "foo()" ); |
97 | } | 97 | } |
98 | m_path = QDir::homeDirPath(); | 98 | m_path = QDir::homeDirPath(); |
99 | 99 | ||
100 | QHBox *hbox = new QHBox( this ); | 100 | QHBox *hbox = new QHBox( this ); |
101 | QLabel* lbl = new QLabel( hbox ); | 101 | QLabel* lbl = new QLabel( hbox ); |
102 | lbl->setText( tr("View as" ) ); | 102 | lbl->setText( tr("View as" ) ); |
103 | 103 | ||
104 | m_views = new QComboBox( hbox, "View As" ); | 104 | m_views = new QComboBox( hbox, "View As" ); |
105 | connect( m_views, SIGNAL(activated(int)), | 105 | connect( m_views, SIGNAL(activated(int)), |
106 | this, SLOT(slotViewChanged(int)) ); | 106 | this, SLOT(slotViewChanged(int)) ); |
107 | 107 | ||
108 | m_view= new QIconView( this ); | 108 | m_view= new QIconView( this ); |
@@ -137,24 +137,28 @@ void PIconView::slotChangeDir(const QString& path) { | |||
137 | 137 | ||
138 | PDirLister *lister = currentView()->dirLister(); | 138 | PDirLister *lister = currentView()->dirLister(); |
139 | if (!lister ) | 139 | if (!lister ) |
140 | return; | 140 | return; |
141 | 141 | ||
142 | lister->setStartPath( path ); | 142 | lister->setStartPath( path ); |
143 | m_path = lister->currentPath(); | 143 | m_path = lister->currentPath(); |
144 | 144 | ||
145 | m_view->clear(); | 145 | m_view->clear(); |
146 | addFolders( lister->folders() ); | 146 | addFolders( lister->folders() ); |
147 | addFiles( lister->files() ); | 147 | addFiles( lister->files() ); |
148 | 148 | ||
149 | // Also invalidate the cache. We can't cancel the operations anyway | ||
150 | g_stringPix.clear(); | ||
151 | g_stringInf.clear(); | ||
152 | |||
149 | // looks ugly | 153 | // looks ugly |
150 | static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) ); | 154 | static_cast<QMainWindow*>(parent())->setCaption( QObject::tr("%1 - O View", "Name of the dir").arg( m_path ) ); |
151 | } | 155 | } |
152 | 156 | ||
153 | QString PIconView::currentFileName(bool &isDir)const { | 157 | QString PIconView::currentFileName(bool &isDir)const { |
154 | isDir = false; | 158 | isDir = false; |
155 | QIconViewItem* _it = m_view->currentItem(); | 159 | QIconViewItem* _it = m_view->currentItem(); |
156 | if ( !_it ) | 160 | if ( !_it ) |
157 | return QString::null; | 161 | return QString::null; |
158 | 162 | ||
159 | IconViewItem* it = static_cast<IconViewItem*>( _it ); | 163 | IconViewItem* it = static_cast<IconViewItem*>( _it ); |
160 | isDir = it->isDir(); | 164 | isDir = it->isDir(); |
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 | |||
@@ -9,26 +9,31 @@ | |||
9 | QDataStream & operator << (QDataStream & str, bool b) | 9 | QDataStream & operator << (QDataStream & str, bool b) |
10 | { | 10 | { |
11 | str << Q_INT8(b); | 11 | str << Q_INT8(b); |
12 | return str; | 12 | return str; |
13 | } | 13 | } |
14 | QDataStream & operator >> (QDataStream & str, bool & b) | 14 | QDataStream & operator >> (QDataStream & str, bool & b) |
15 | { | 15 | { |
16 | Q_INT8 l; | 16 | Q_INT8 l; |
17 | str >> l; | 17 | str >> l; |
18 | b = bool(l); | 18 | b = bool(l); |
19 | return str; | 19 | return str; |
20 | } | 20 | } |
21 | |||
22 | /* | ||
23 | * ! We don't put a Pixmap in!!!! | ||
24 | */ | ||
21 | QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { | 25 | QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { |
22 | return s << inf.file << inf.pixmap << inf.width << inf.height; | 26 | qWarning( "Image request is %s %d %d", inf.file.latin1(), inf.width, inf.height ); |
27 | return s << inf.file << inf.width << inf.height; | ||
23 | } | 28 | } |
24 | QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { | 29 | QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { |
25 | s >> inf.file >> inf.pixmap >> inf.width >> inf.height; | 30 | s >> inf.file >> inf.pixmap >> inf.width >> inf.height; |
26 | return s; | 31 | return s; |
27 | } | 32 | } |
28 | QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { | 33 | QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { |
29 | return s << i.kind << i.file << i.info; | 34 | return s << i.kind << i.file << i.info; |
30 | } | 35 | } |
31 | QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { | 36 | QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { |
32 | s >> i.kind >> i.file >> i.info; | 37 | s >> i.kind >> i.file >> i.info; |
33 | return s; | 38 | return s; |
34 | } | 39 | } |
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 | |||
@@ -22,26 +22,31 @@ QDataStream & operator >> (QDataStream & str, bool & b) | |||
22 | { | 22 | { |
23 | Q_INT8 l; | 23 | Q_INT8 l; |
24 | str >> l; | 24 | str >> l; |
25 | b = bool(l); | 25 | b = bool(l); |
26 | return str; | 26 | return str; |
27 | } | 27 | } |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { | 31 | QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { |
32 | return s << inf.file << inf.pixmap << inf.width << inf.height; | 32 | return s << inf.file << inf.pixmap << inf.width << inf.height; |
33 | } | 33 | } |
34 | |||
35 | /* | ||
36 | * GUI sends no QPIxmap!!! | ||
37 | */ | ||
34 | QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { | 38 | QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { |
35 | s >> inf.file >> inf.pixmap >> inf.width >> inf.height; | 39 | s >> inf.file >> inf.width >> inf.height; |
40 | qWarning( "Recieved %s %d %d", inf.file.latin1(), inf.width, inf.height ); | ||
36 | return s; | 41 | return s; |
37 | } | 42 | } |
38 | QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { | 43 | QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { |
39 | return s << i.kind << i.file << i.info; | 44 | return s << i.kind << i.file << i.info; |
40 | } | 45 | } |
41 | QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { | 46 | QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { |
42 | s >> i.kind >> i.file >> i.info; | 47 | s >> i.kind >> i.file >> i.info; |
43 | return s; | 48 | return s; |
44 | } | 49 | } |
45 | 50 | ||
46 | 51 | ||
47 | 52 | ||