summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.cc
Side-by-side diff
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
@@ -185,12 +185,8 @@ 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 )
@@ -326,9 +322,8 @@ 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();
@@ -401,9 +396,7 @@ 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: