Commit a9a18f75 authored by Alexander Bikadorov's avatar Alexander Bikadorov
Browse files

Fixing various coding problems found with static code analysis tools.

Summary:
Fixing minor memory leak.

Cleanup of unused class declarations

Cleanup of unused #includes

Cleanup of invalid forward declarations

Cleanup of duplicate #includes

Cleanup of unused variable

Cleanup of duplicate declarations

Cleanup of obsolete forward declaration

Test Plan: Still compiles .)

Reviewers: #krusader, asensi

Reviewed By: #krusader, asensi

Subscribers: asensi

Differential Revision: https://phabricator.kde.org/D2119
parent d1876e0c
......@@ -20,7 +20,6 @@
#include "addplaceholderpopup.h"
#include "../UserAction/expander.h"
// for ParameterDialog
#include "../krglobal.h" // for konfig-access
#include "../BookMan/krbookmarkbutton.h"
......
......@@ -23,13 +23,13 @@
// QtCore
#include <QList>
#include <QString>
// QtWidgets
#include <QDialog>
#include <QMenu>
#include "../UserAction/expander.h"
class QString;
class KLineEdit;
class QToolButton;
class QCheckBox;
......
......@@ -21,7 +21,6 @@
#define KRADDBOOKMARKDLG_H
#include "krbookmark.h"
#include "../VFS/vfs.h"
#include "../GUI/krtreewidget.h"
// QtCore
......
......@@ -25,8 +25,6 @@
#include <KWidgetsAddons/KActionMenu>
#include "krbookmarkhandler.h"
class KrBookmarkButton: public QToolButton
{
Q_OBJECT
......
......@@ -19,6 +19,8 @@
#include "krbookmarkhandler.h"
#include "kraddbookmarkdlg.h"
#include "../krglobal.h"
#include "../krslots.h"
#include "../kractions.h"
#include "../filemanagerwindow.h"
......
......@@ -42,8 +42,6 @@
#include "newftpgui.h"
#include "../VFS/krquery.h"
class newFTPGUI;
class KRMaskChoiceSub;
class KRSpWidgets
......
......@@ -39,7 +39,6 @@
#include <QVBoxLayout>
#include <QLabel>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QCheckBox;
......
......@@ -19,6 +19,8 @@
#ifndef FILETREE_H
#define FILETREE_H
#include <QString>
#include <KIO/Global>
// TODO these are pointlessly general purpose now, make them incredibly specific
......@@ -202,7 +204,6 @@ private:
class Directory;
class QString;
class File
{
......
......@@ -18,7 +18,6 @@
#include "builder.h"
#include "Config.h"
#include "fileTree.h"
#include "widget.h"
// QtCore
......
......@@ -32,7 +32,6 @@
#define ADVANCEDFILTER_H
#include "filterbase.h"
#include "../VFS/krquery.h"
// QtWidgets
#include <QWidget>
......
......@@ -32,7 +32,6 @@
#define FILTERBASE_H
#include "filtersettings.h"
#include "../VFS/krquery.h"
// QtCore
#include <QString>
......
......@@ -44,7 +44,6 @@
#include <KCompletion/KHistoryComboBox>
#include "filterbase.h"
#include "../VFS/krquery.h"
#include "../Dialogs/kurllistrequester.h"
#include "../GUI/profilemanager.h"
#include "../GUI/krlistwidget.h"
......
......@@ -44,7 +44,6 @@
#include <KXmlGui/KShortcutsDialog>
#include <KXmlGui/KToolBar>
#include "../krglobal.h"
#include "../defaults.h"
#include "../kicons.h"
#include "panelviewer.h"
......
......@@ -43,6 +43,7 @@
#include "krresulttabledialog.h"
#include "searchobject.h"
#include "../defaults.h"
#include "../krglobal.h"
#include "../VFS/krarchandler.h"
KgArchives::KgArchives(bool first, QWidget* parent) :
......
......@@ -49,6 +49,7 @@
#include "krresulttabledialog.h"
#include "../defaults.h"
#include "../kicons.h"
#include "../krglobal.h"
#define PAGE_GENERAL 0
#define PAGE_VIEWER 1
......
......@@ -41,8 +41,6 @@
#include "konfiguratoritems.h"
struct KONFIGURATOR_CHECKBOX_PARAM;
struct KONFIGURATOR_NAME_VALUE_TIP;
struct KONFIGURATOR_NAME_VALUE_PAIR;
/**
* KonfiguratorPage is responsible for handling pages in Konfigurator.
......
......@@ -31,6 +31,9 @@
#include <KI18n/KLocalizedString>
#include "../krservices.h"
#include "../VFS/krarchandler.h"
using namespace std;
#define PS(x) _supported.contains(x)>0
......
......@@ -33,9 +33,6 @@
#include <KWidgetsAddons/KUrlLabel>
#include "searchobject.h"
#include "../krglobal.h"
#include "../krservices.h"
#include "../VFS/krarchandler.h"
class KrResultTable : public QWidget
{
......
......@@ -30,6 +30,8 @@
#include <KConfigWidgets/KHelpClient>
#include <KIconThemes/KIconLoader>
#include "../krglobal.h"
KrResultTableDialog::KrResultTableDialog(QWidget *parent, DialogType type,
const QString& caption, const QString& heading, const QString& headerIcon,
const QString& hint)
......
......@@ -18,6 +18,8 @@
#include "searchobject.h"
#include "../krservices.h"
SearchObject::SearchObject()
{
}
......
......@@ -23,8 +23,6 @@
#include <QString>
#include <QList>
# include "../krservices.h"
class SearchObject
{
public:
......
......@@ -48,7 +48,6 @@ A
#include <Solid/SolidNamespace>
class KMountManGUI;
class QAction;
class KToolBarPopupAction;
class KMountMan : public QObject
......
......@@ -29,9 +29,7 @@ A
***************************************************************************/
#include "kmountmangui.h"
#include "kmountman.h"
#include "../krglobal.h"
#include "../Dialogs/krspecialwidgets.h"
#include "../kicons.h"
......
......@@ -39,6 +39,7 @@
#include "krvfsmodel.h"
#include "../VFS/krpermhandler.h"
#include "../defaults.h"
#include "../krglobal.h"
#include "krmousehandler.h"
#include "krcolorcache.h"
#include "../GUI/krstyleproxy.h"
......
......@@ -23,9 +23,9 @@
// QtWidgets
#include <QAbstractItemView>
#include "krviewitem.h"
#include "krinterview.h"
#include "krvfsmodel.h"
#include "krviewitem.h"
// dummy. remove this class when no longer needed
class KrInterViewItem: public KrViewItem
......
......@@ -17,7 +17,9 @@
*****************************************************************************/
#include "krinterviewitemdelegate.h"
#include "krvfsmodel.h"
#include "../krglobal.h"
// QtGui
#include <QPainter>
......
......@@ -44,6 +44,7 @@
#include "../krusaderview.h"
#include "../panelmanager.h"
#include "../krtrashhandler.h"
#include "../UserAction/useractionpopupmenu.h"
#include "../VFS/krarchandler.h"
#ifdef __LIBKONQ__
......
......@@ -32,8 +32,6 @@
#endif
#include "krpreviewpopup.h"
#include "krviewitem.h"
#include "../UserAction/useractionpopupmenu.h"
class KActionCollection;
class KrPanel;
......
......@@ -29,7 +29,6 @@ A
***************************************************************************/
#include "krpreviewjob.h"
#include "krpreviews.h"
#include "krview.h"
#include "krviewitem.h"
......
......@@ -43,8 +43,6 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
#include "krpreviews.h"
class KrView;
class KrViewItem;
class KrPreviews;
......
......@@ -23,7 +23,6 @@
#include <QMimeDatabase>
#include <QMimeType>
#include "krview.h"
#include "../VFS/krpermhandler.h"
namespace KrSort {
......
......@@ -34,7 +34,6 @@
#include "krpanel.h"
#include "krcolorcache.h"
#include "krsort.h"
KrVfsModel::KrVfsModel(KrInterView * view): QAbstractListModel(0), _extensionEnabled(true), _view(view),
......
......@@ -37,6 +37,7 @@
#include "krcolorcache.h"
#include "krpreviews.h"
#include "../kicons.h"
#include "../krglobal.h"
#include "../defaults.h"
#include "../VFS/krpermhandler.h"
#include "../VFS/vfilecontainer.h"
......
......@@ -41,7 +41,6 @@
#include <QPixmap>
#include <QDropEvent>
#include "../krglobal.h"
#include "../VFS/krquery.h"
#include "../Filter/filtersettings.h"
......@@ -50,7 +49,6 @@
class KrView;
class KrViewItem;
class KrPreviews;
class QModelIndex;
class KrViewInstance;
class VfileContainer;
......
......@@ -21,6 +21,7 @@
#include "../VFS/krpermhandler.h"
// QtCore
#include <QLocale>
#include <QMimeDatabase>
#include <QMimeType>
// QtGui
......
......@@ -23,12 +23,13 @@
#include "../VFS/vfile.h"
#include "krview.h"
// QtCore
#include <QString>
// QtGui
#include <QPixmap>
#include <KIO/Global>
class QString;
class QPixmap;
class KrViewItem
......
......@@ -61,13 +61,12 @@
#include <KIOFileWidgets/KUrlNavigator>
#include "krpanel.h"
#include "krview.h"
#include "krviewitem.h"
#include "../Dialogs/krsqueezedtextlabel.h"
#define PROP_SYNC_BUTTON_ON 1
#define PROP_LOCKED 2
class vfs;
class KrView;
class KrSearchBar;
class DirHistoryButton;
......
......@@ -40,7 +40,6 @@
class FileManagerWindow;
class KrPanel;
class ListPanel;
class ListPanelFunc;
class ListPanelActions : public ActionsBase
......
......@@ -19,13 +19,14 @@
#ifndef LISTPANELFRAME_H
#define LISTPANELFRAME_H
// QtGui
#include <QDropEvent>
// QtWidgets
#include <QFrame>
# include <KConfigCore/KConfigGroup>
class QDragEnterEvent;
class QDropEvent;
class ListPanelFrame : public QFrame
{
......
......@@ -75,7 +75,6 @@ A
#include "../abstractpanelmanager.h"
#include "../krservices.h"
#include "../VFS/vfile.h"
#include "../VFS/vfs.h"
#include "../VFS/virt_vfs.h"
#include "../VFS/krarchandler.h"
#include "../VFS/krpermhandler.h"
......
......@@ -45,6 +45,7 @@
#include <KService/KService>
class DirHistoryQueue;
class ListPanel;
class ListPanelFunc : public QObject
{
......
......@@ -37,7 +37,6 @@
#include <KIOFileWidgets/KImageFilePreview>
class QButtonGroup;
class QLabel;
class QSplitter;
class QToolButton;
class KrSqueezedTextLabel;
......@@ -48,7 +47,6 @@ class DiskUsageViewer;
class KrFileTreeView;
class KDirModel;
class KDirSortFilterProxyModel;
class QPoint;
class vfile;
class FileManagerWindow;
......
......@@ -18,7 +18,6 @@
#include "queue_mgr.h"
#include "queuedialog.h"
#include "queue.h"
// QtCore
#include <QList>
......
......@@ -52,7 +52,6 @@
#include <KI18n/KLocalizedString>
#include <KWidgetsAddons/KMessageBox>
#include "krsearchmod.h"
#include "../krglobal.h"
#include "../kractions.h"
#include "../krservices.h"
......
......@@ -38,7 +38,6 @@
#include <QProgressBar>
#include <QPushButton>
#include "../VFS/vfs.h"
#include "synchronizer.h"
class SynchronizeDialog : QDialog
......
......@@ -60,8 +60,6 @@ using namespace std;
#define NEED_PANEL if (panel==0) { panelMissingError(_expression,exp); return QString(); }
#include "tstring.h"
inline void exp_placeholder::setError(Expander& exp, const Error& e)
{
......
......@@ -24,6 +24,8 @@
// QtCore
#include <QByteArray>
#include <QUrl>
// QtGui
#include <QFont>
// QtWidgets
#include <QAction>
#include <QDialog>
......@@ -33,7 +35,6 @@
#include "kractionbase.h"
class UserActionProperties;
class QDomDocument;
class QDomElement;
class KActionCollection;
......@@ -180,7 +181,6 @@ private:
KActionCollection *_actionCollection;
};
class QFont;
/**
* This displays the output of a process
*/
......
......@@ -27,7 +27,6 @@
#include "kraction.h"
#include "../krglobal.h"
#include "expander.h"
KrActionBase::~KrActionBase()
{
......
......@@ -26,7 +26,6 @@
class QDomDocument;
class QDomElement;
class QString;
class QStringList;
class KrAction;
class QUrl;
......
......@@ -22,8 +22,8 @@
// QtWidgets
#include <QMenu>
#include <QWidget>
class QWidget;
class UserMenu;
class QAction;
......
......@@ -23,8 +23,6 @@
#include <KCoreAddons/KProcess>
#include "../krservices.h"
class Kr7zEncryptionChecker : public KProcess
{
Q_OBJECT
......
......@@ -45,10 +45,12 @@
#include <KWidgetsAddons/KMessageBox>
#include <KWidgetsAddons/KPasswordDialog>
#include "kr7zencryptionchecker.h"
#include "../krglobal.h"
#include "../defaults.h"
#include "../krservices.h"
#include "../Dialogs/krpleasewait.h"
#include "../../krArc/krlinecountingprocess.h"
#if 0
class DefaultKRarcObserver : public KRarcObserver
......
......@@ -38,8 +38,6 @@
#include <KCoreAddons/KProcess>
#include "../../krArc/krarcbasemanager.h"
#include "../../krArc/krlinecountingprocess.h"
#include "kr7zencryptionchecker.h"
namespace KWallet {
class Wallet;
......
......@@ -19,6 +19,8 @@
#ifndef FILEMANAGERWINDOW_H
#define FILEMANAGERWINDOW_H
#include <QAction>
#include "krmainwindow.h"
#include "abstractpanelmanager.h"
......
......@@ -49,9 +49,7 @@ class KIconLoader;
class KrusaderView;
class UserAction;
class QWidget;
class ListPanel;
class KrPanel;
class QAction;
// global references to frequently used objects
......
......@@ -21,7 +21,6 @@
class QWidget;
class KrView;
class QAction;
class KActionCollection;
class ViewActions;
......
......@@ -45,14 +45,6 @@ bool KrServices::cmdExist(QString cmdName)
return !QStandardPaths::findExecutable(cmdName).isEmpty();
}
static const QStringList bin_suffixes = QStringList()
#ifdef Q_WS_WIN
<< ".cmd" << ".exe" << ".bat"
#else
<< ""
#endif
;
QString