-rw-r--r-- | libopie/ofileselector.cc | 13 |
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 @@ -184,14 +184,10 @@ void OFileSelector::reread() } const DocLnk *OFileSelector::selected() { - if( m_selector == NORMAL ){ - return m_select->selected(); - }else{ DocLnk *lnk = new DocLnk(selectedDocument() ); return lnk; - } } void OFileSelector::setYesCancelVisible( bool show ) { @@ -325,11 +321,10 @@ void OFileSelector::setPopupMenu(QPopupMenu *popup ) QString OFileSelector::selectedName() const { QString name; if( m_selector == NORMAL ){ - const DocLnk *lnk = m_select->selected(); - name = lnk->file(); - delete lnk; + DocLnk lnk = m_select->selectedDocument(); + name = lnk.file(); }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ if ( m_shLne ) { name = m_currentDir + "/" +m_edit->text(); }else{ @@ -400,11 +395,9 @@ DocLnk OFileSelector::selectedDocument() const { DocLnk lnk; switch( m_selector ){ case NORMAL:{ - const DocLnk *lnk2 = m_select->selected(); - lnk = DocLnk(*lnk2 ); // copy - delete lnk2; + lnk = m_select->selectedDocument(); break; } case EXTENDED: case EXTENDED_ALL: |