summaryrefslogtreecommitdiffstats
path: root/tdefilereplace
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-06-21 00:31:23 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-06-21 00:31:23 +0900
commitc722431cbb37b120038bd2d0731e7ef74cce9d75 (patch)
tree2f1d4ceba10d96e3635301290fa4df00aad8c7ea /tdefilereplace
parenta58ed210742d83bf1ce96194083eb925298b02c5 (diff)
downloadtdeutils-c722431cbb37b120038bd2d0731e7ef74cce9d75.tar.gz
tdeutils-c722431cbb37b120038bd2d0731e7ef74cce9d75.zip
tdefilereplace: fixed SEGFAULT when trying to delete or remove an entry
from the result listview. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdefilereplace')
-rw-r--r--tdefilereplace/tdefilereplaceview.cpp23
-rw-r--r--tdefilereplace/tdefilereplaceview.h1
2 files changed, 2 insertions, 22 deletions
diff --git a/tdefilereplace/tdefilereplaceview.cpp b/tdefilereplace/tdefilereplaceview.cpp
index aa73fa8..b147da7 100644
--- a/tdefilereplace/tdefilereplaceview.cpp
+++ b/tdefilereplace/tdefilereplaceview.cpp
@@ -85,16 +85,8 @@ TQString TDEFileReplaceView::getItemPath(const TQListViewItem *lvi)
TQListViewItem* TDEFileReplaceView::getCurrItemTopLevelParent()
{
- TQListViewItem *lvi;
- if (!m_lviCurrent)
- {
- lvi = m_rv->currentItem();
- }
- else
- {
- lvi = (TQListViewItem*)m_lviCurrent;
- }
- while (lvi->parent())
+ TQListViewItem *lvi = m_rv->currentItem();
+ while (lvi && lvi->parent())
{
lvi = lvi->parent();
}
@@ -221,7 +213,6 @@ void TDEFileReplaceView::slotResultMouseButtonClicked(int button, TQListViewItem
if (button == Qt::RightButton)
{
// Right mouse button: open popup menub
- m_lviCurrent = static_cast<TDEListViewItem*>(lvi);
m_menuResult->popup(pos);
}
}
@@ -232,7 +223,6 @@ void TDEFileReplaceView::slotResultReturnPressed (TQListViewItem *lvi)
return;
// Left mouse button: open item in default view
- m_lviCurrent = static_cast<TDEListViewItem*>(lvi);
slotResultOpen();
}
@@ -243,7 +233,6 @@ void TDEFileReplaceView::slotResultProperties()
{
KURL url(currItemPath);
(void) new KPropertiesDialog(url);
- m_lviCurrent = 0;
}
}
@@ -253,7 +242,6 @@ void TDEFileReplaceView::slotResultOpen()
if (!currItemPath.isEmpty())
{
(void) new KRun(KURL(currItemPath), 0, true, true);
- m_lviCurrent = 0;
}
}
@@ -265,7 +253,6 @@ void TDEFileReplaceView::slotResultOpenWith()
KURL::List kurls;
kurls.append(KURL(currItemPath));
KRun::displayOpenWithDialog(kurls);
- m_lviCurrent = 0;
}
}
@@ -277,7 +264,6 @@ void TDEFileReplaceView::slotResultDirOpen()
TQFileInfo fi;
fi.setFile(currItemPath);
(void) new KRun (KURL::fromPathOrURL(fi.dirPath()), 0, true, true);
- m_lviCurrent = 0;
}
}
@@ -322,8 +308,6 @@ void TDEFileReplaceView::slotResultEdit()
lvi = lvi->nextSibling();
}
-
- m_lviCurrent = 0;
}
void TDEFileReplaceView::slotResultRemoveEntry()
@@ -332,7 +316,6 @@ void TDEFileReplaceView::slotResultRemoveEntry()
if (currItem)
{
delete currItem;
- m_lviCurrent = 0;
}
}
@@ -350,9 +333,7 @@ void TDEFileReplaceView::slotResultDelete()
{
fi.setName(currItemPath);
fi.remove();
-
delete currItem;
- m_lviCurrent = 0;
}
}
}
diff --git a/tdefilereplace/tdefilereplaceview.h b/tdefilereplace/tdefilereplaceview.h
index 36eaa9c..cd30b4d 100644
--- a/tdefilereplace/tdefilereplaceview.h
+++ b/tdefilereplace/tdefilereplaceview.h
@@ -113,7 +113,6 @@ class TDEFileReplaceView : public TDEFileReplaceViewWdg
private:
TDEPopupMenu *m_menuResult;
RCOptions *m_option;
- TDEListViewItem *m_lviCurrent;
TDEListView *m_rv, * m_sv;
};