mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 10:22:50 +00:00
kman: fix possible null-pointer dereference
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e87e117174
commit
2345dd7b51
1 changed files with 7 additions and 6 deletions
|
@ -44,9 +44,6 @@ class KManLister : public QThread {
|
|||
public:
|
||||
KManLister(QObject *parent = Q_NULLPTR);
|
||||
|
||||
QList<QByteArray> m_paths;
|
||||
bool m_interrupt;
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotScan(QString path);
|
||||
|
||||
|
@ -58,7 +55,9 @@ class KManLister : public QThread {
|
|||
virtual void run();
|
||||
|
||||
private:
|
||||
QList<QByteArray> m_paths;
|
||||
QFileSystemWatcher m_watcher;
|
||||
bool m_interrupt;
|
||||
};
|
||||
|
||||
KManLister::KManLister(QObject *parent)
|
||||
|
@ -363,10 +362,12 @@ QString KManMainWindow::manContent(const QString path) {
|
|||
QByteArray content;
|
||||
if (path.endsWith(".gz") || path.endsWith(".bz2") || path.endsWith(".xz")) {
|
||||
QIODevice *archivedevice = KFilterDev::deviceForFile(path);
|
||||
if (archivedevice && archivedevice->open(QFile::ReadOnly)) {
|
||||
content = archivedevice->readAll();
|
||||
if (archivedevice) {
|
||||
if (archivedevice->open(QFile::ReadOnly)) {
|
||||
content = archivedevice->readAll();
|
||||
}
|
||||
archivedevice->deleteLater();
|
||||
}
|
||||
archivedevice->deleteLater();
|
||||
} else {
|
||||
if (pathfile.open(QFile::ReadOnly)) {
|
||||
content = pathfile.readAll();
|
||||
|
|
Loading…
Add table
Reference in a new issue