summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.cc
Unidiff
Diffstat (limited to 'libopie/ofileselector.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 3c3a6c4..b3aacd6 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -182,18 +182,14 @@ void OFileSelector::reread()
182 //; 182 //;
183 } 183 }
184} 184}
185 185
186const DocLnk *OFileSelector::selected() 186const DocLnk *OFileSelector::selected()
187{ 187{
188 if( m_selector == NORMAL ){
189 return m_select->selected();
190 }else{
191 DocLnk *lnk = new DocLnk(selectedDocument() ); 188 DocLnk *lnk = new DocLnk(selectedDocument() );
192 return lnk; 189 return lnk;
193 }
194} 190}
195 191
196void OFileSelector::setYesCancelVisible( bool show ) 192void OFileSelector::setYesCancelVisible( bool show )
197{ 193{
198 initializeYes(); // FIXME if YesCancel is not shown we will initialize it to hide it :( 194 initializeYes(); // FIXME if YesCancel is not shown we will initialize it to hide it :(
199 m_shYesNo = show; 195 m_shYesNo = show;
@@ -323,15 +319,14 @@ void OFileSelector::setPopupMenu(QPopupMenu *popup )
323//void OFileSelector::updateL 319//void OFileSelector::updateL
324 320
325QString OFileSelector::selectedName() const 321QString OFileSelector::selectedName() const
326{ 322{
327 QString name; 323 QString name;
328 if( m_selector == NORMAL ){ 324 if( m_selector == NORMAL ){
329 const DocLnk *lnk = m_select->selected(); 325 DocLnk lnk = m_select->selectedDocument();
330 name = lnk->file(); 326 name = lnk.file();
331 delete lnk;
332 }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ 327 }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){
333 if ( m_shLne ) { 328 if ( m_shLne ) {
334 name = m_currentDir + "/" +m_edit->text(); 329 name = m_currentDir + "/" +m_edit->text();
335 }else{ 330 }else{
336 QListViewItem *item = m_View->currentItem(); 331 QListViewItem *item = m_View->currentItem();
337 if( item != 0 ) 332 if( item != 0 )
@@ -398,15 +393,13 @@ int OFileSelector::fileCount()
398} 393}
399DocLnk OFileSelector::selectedDocument() const 394DocLnk OFileSelector::selectedDocument() const
400{ 395{
401 DocLnk lnk; 396 DocLnk lnk;
402 switch( m_selector ){ 397 switch( m_selector ){
403 case NORMAL:{ 398 case NORMAL:{
404 const DocLnk *lnk2 = m_select->selected(); 399 lnk = m_select->selectedDocument();
405 lnk = DocLnk(*lnk2 ); // copy
406 delete lnk2;
407 break; 400 break;
408 } 401 }
409 case EXTENDED: 402 case EXTENDED:
410 case EXTENDED_ALL: 403 case EXTENDED_ALL:
411 default: 404 default:
412 lnk = DocLnk( selectedName() ); // new DocLnk 405 lnk = DocLnk( selectedName() ); // new DocLnk