summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2002-03-30 23:55:35 (UTC)
committer zecke <zecke>2002-03-30 23:55:35 (UTC)
commit04158decf6fa76d966be178d07e1895336a47bd9 (patch) (unidiff)
tree4c8e254088074278ed3a98b021185d24f6dc42e0 /libopie
parent5d12c8fb75458262f6414073759b4c610f615525 (diff)
downloadopie-04158decf6fa76d966be178d07e1895336a47bd9.zip
opie-04158decf6fa76d966be178d07e1895336a47bd9.tar.gz
opie-04158decf6fa76d966be178d07e1895336a47bd9.tar.bz2
fix crash
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 1807575..128292f 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -151,48 +151,49 @@ void OFileSelector::initPics()
151 | LineEdit | 151 | LineEdit |
152 ____________________ 152 ____________________
153 | Permission Bar | 153 | Permission Bar |
154 ____________________ 154 ____________________
155 | ViewChoose | 155 | ViewChoose |
156 ____________________ 156 ____________________
157 | Save Cancel| 157 | Save Cancel|
158 ____________________ 158 ____________________
159 */ 159 */
160void OFileSelector::delItems() 160void OFileSelector::delItems()
161{ 161{
162 QLayoutIterator it = m_lay->iterator(); 162 QLayoutIterator it = m_lay->iterator();
163 while ( it.current() != 0 ){ 163 while ( it.current() != 0 ){
164 it.deleteCurrent(); 164 it.deleteCurrent();
165 } 165 }
166} 166}
167void OFileSelector::init() 167void OFileSelector::init()
168{ 168{
169 169
170 m_stack = new QWidgetStack(this, "wstack" ); 170 m_stack = new QWidgetStack(this, "wstack" );
171 if( m_selector == NORMAL ){ 171 if( m_selector == NORMAL ){
172 QString currMime; 172 QString currMime;
173 if( m_mimeCheck != 0 ) 173 if( m_mimeCheck != 0 )
174 currMime = m_mimeCheck->currentText(); 174 currMime = m_mimeCheck->currentText();
175
175 updateMimes(); 176 updateMimes();
176 m_select = new FileSelector( currMime == "All" ? QString::null : currMime , m_stack, "fileselector", FALSE, FALSE ); 177 m_select = new FileSelector( currMime == "All" ? QString::null : currMime , m_stack, "fileselector", FALSE, FALSE );
177 m_stack->addWidget(m_select, NORMAL ); 178 m_stack->addWidget(m_select, NORMAL );
178 m_lay->addWidget(m_stack ); 179 m_lay->addWidget(m_stack );
179 m_stack->raiseWidget(NORMAL ); 180 m_stack->raiseWidget(NORMAL );
180 }else { 181 }else {
181 initializeListView(); 182 initializeListView();
182 } 183 }
183 184
184 if(m_shLne ){ 185 if(m_shLne ){
185 initializeName(); 186 initializeName();
186 } 187 }
187 188
188 if(m_shPerm ){ 189 if(m_shPerm ){
189 m_checkPerm = new QCheckBox(tr("Set Permission"), this, "Permission" ); 190 m_checkPerm = new QCheckBox(tr("Set Permission"), this, "Permission" );
190 m_checkPerm->setChecked( false ); 191 m_checkPerm->setChecked( false );
191 m_lay->addWidget(m_checkPerm ); 192 m_lay->addWidget(m_checkPerm );
192 } 193 }
193 194
194 if( m_shChooser ) 195 if( m_shChooser )
195 initializeChooser(); 196 initializeChooser();
196 197
197 if(m_shYesNo ) 198 if(m_shYesNo )
198 initializeYes(); 199 initializeYes();
@@ -316,54 +317,61 @@ QStringList OFileSelector::selectedNames()const
316DocLnk OFileSelector::selectedDocument( )const 317DocLnk OFileSelector::selectedDocument( )const
317{ 318{
318 DocLnk lnk; 319 DocLnk lnk;
319 return lnk; 320 return lnk;
320} 321}
321void OFileSelector::updateLay() 322void OFileSelector::updateLay()
322{ 323{
323 /* if( m_shTool ) 324 /* if( m_shTool )
324 // 325 //
325 else 326 else
326 // hide 327 // hide
327 */ 328 */
328 // save the state 329 // save the state
329 bool check = false; 330 bool check = false;
330 if( m_checkPerm != 0 ) 331 if( m_checkPerm != 0 )
331 check = m_checkPerm->isChecked(); 332 check = m_checkPerm->isChecked();
332 QString text; 333 QString text;
333 334
334 if( m_edit != 0 ) 335 if( m_edit != 0 )
335 text = m_edit->text(); 336 text = m_edit->text();
336 // save current mimetype 337 // save current mimetype
337 338
338 delItems(); 339 delItems();
339 delete m_checkPerm; 340 delete m_checkPerm;
341 m_checkPerm = 0;
340 delete m_edit; 342 delete m_edit;
343 m_edit = 0;
341 delete m_fnLabel; 344 delete m_fnLabel;
345 m_fnLabel = 0;
342 delete m_ok; 346 delete m_ok;
347 m_ok = 0;
343 delete m_cancel; 348 delete m_cancel;
349 m_cancel = 0;
344 delete m_mimeCheck; 350 delete m_mimeCheck;
351 m_mimeCheck = 0;
345 delete m_viewCheck; 352 delete m_viewCheck;
353 m_viewCheck = 0;
346 delete m_select; // test 354 delete m_select; // test
347 delete m_stack; 355 delete m_stack;
348 //delete m_list; 356 //delete m_list;
349 init(); 357 init();
350 if( m_shLne ) 358 if( m_shLne )
351 m_edit->setText(text ); 359 m_edit->setText(text );
352 if( m_shPerm ) 360 if( m_shPerm )
353 m_checkPerm->setChecked(check ); 361 m_checkPerm->setChecked(check );
354} 362}
355// let's update the mimetypes. Use the current mimefilter for the 2nd QDir retrieve 363// let's update the mimetypes. Use the current mimefilter for the 2nd QDir retrieve
356// insert QListViewItems with the right options 364// insert QListViewItems with the right options
357bool OFileSelector::compliesMime(const QString &path, const QString &mime ) 365bool OFileSelector::compliesMime(const QString &path, const QString &mime )
358{ 366{
359 if( mime == "All" ) 367 if( mime == "All" )
360 return true; 368 return true;
361 MimeType type( path ); 369 MimeType type( path );
362 if( type.id() == mime ) 370 if( type.id() == mime )
363 return true; 371 return true;
364 return false; 372 return false;
365} 373}
366 374
367void OFileSelector::reparse() 375void OFileSelector::reparse()
368{ 376{
369 if(m_View== 0 || m_selector == NORMAL) 377 if(m_View== 0 || m_selector == NORMAL)