mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 18:32:51 +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:
|
public:
|
||||||
KManLister(QObject *parent = Q_NULLPTR);
|
KManLister(QObject *parent = Q_NULLPTR);
|
||||||
|
|
||||||
QList<QByteArray> m_paths;
|
|
||||||
bool m_interrupt;
|
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void slotScan(QString path);
|
void slotScan(QString path);
|
||||||
|
|
||||||
|
@ -58,7 +55,9 @@ class KManLister : public QThread {
|
||||||
virtual void run();
|
virtual void run();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QList<QByteArray> m_paths;
|
||||||
QFileSystemWatcher m_watcher;
|
QFileSystemWatcher m_watcher;
|
||||||
|
bool m_interrupt;
|
||||||
};
|
};
|
||||||
|
|
||||||
KManLister::KManLister(QObject *parent)
|
KManLister::KManLister(QObject *parent)
|
||||||
|
@ -363,10 +362,12 @@ QString KManMainWindow::manContent(const QString path) {
|
||||||
QByteArray content;
|
QByteArray content;
|
||||||
if (path.endsWith(".gz") || path.endsWith(".bz2") || path.endsWith(".xz")) {
|
if (path.endsWith(".gz") || path.endsWith(".bz2") || path.endsWith(".xz")) {
|
||||||
QIODevice *archivedevice = KFilterDev::deviceForFile(path);
|
QIODevice *archivedevice = KFilterDev::deviceForFile(path);
|
||||||
if (archivedevice && archivedevice->open(QFile::ReadOnly)) {
|
if (archivedevice) {
|
||||||
content = archivedevice->readAll();
|
if (archivedevice->open(QFile::ReadOnly)) {
|
||||||
|
content = archivedevice->readAll();
|
||||||
|
}
|
||||||
|
archivedevice->deleteLater();
|
||||||
}
|
}
|
||||||
archivedevice->deleteLater();
|
|
||||||
} else {
|
} else {
|
||||||
if (pathfile.open(QFile::ReadOnly)) {
|
if (pathfile.open(QFile::ReadOnly)) {
|
||||||
content = pathfile.readAll();
|
content = pathfile.readAll();
|
||||||
|
|
Loading…
Add table
Reference in a new issue