Commit 60446223 authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Remove dead code

Most of this code has been commented out for over 10 years,
so it is time to actually remove it.
parent c473fa00
......@@ -28,7 +28,6 @@
// QtWidgets
#include <QApplication>
#include <KArchive/KTar>
#include <KConfigCore/KSharedConfig>
#include <KI18n/KLocalizedString>
#include <KIO/Global>
......@@ -45,44 +44,6 @@
#include "../Dialogs/krpleasewait.h"
#include "../../krArc/krlinecountingprocess.h"
#if 0
class DefaultKrArcObserver : public KrArcObserver
{
public:
DefaultKrArcObserver() {}
virtual ~DefaultKrArcObserver() {}
virtual void processEvents() override {
usleep(1000);
qApp->processEvents();
}
virtual void subJobStarted(const QString & jobTitle, qulonglong count) override {
krApp->startWaiting(jobTitle, count, true);
}
virtual void subJobStopped() override {
krApp->stopWait();
}
virtual bool wasCancelled() override {
return krApp->wasWaitingCancelled();
}
virtual void error(const QString & error) override {
KMessageBox::error(krApp, error, i18n("Error"));
}
virtual void detailedError(const QString & error, const QString & details) override {
KMessageBox::detailedError(krApp, error, details, i18n("Error"));
}
virtual void incrementProgress(int c) override {
krApp->plzWait->incProgress(c);
}
};
#endif
static QStringList arcProtocols = QString("tar;bzip;bzip2;lzma;xz;gzip;krarc;zip").split(';');
QMap<QString, QString>* KrArcHandler::slaveMap = nullptr;
......
......@@ -207,8 +207,6 @@ DULines::DULines(DiskUsage *usage)
header()->setSortIndicatorShown(true);
sortItems(1, Qt::AscendingOrder);
// toolTip = new DULinesToolTip( diskUsage, viewport(), this );
connect(diskUsage, &DiskUsage::enteringDirectory, this, &DULines::slotDirChanged);
connect(diskUsage, &DiskUsage::clearing, this, &DULines::clear);
......
......@@ -30,7 +30,7 @@
#include "Config.h"
#include "fileTree.h"
#include "radialMap.h"
#include "sincos.h"
#include <cmath>
#include "widget.h"
#include "../compat.h"
......@@ -253,9 +253,6 @@ RadialMap::Widget::paintExplodedLabels(QPainter &paint) const
rightSide = ((*it)->a < 1440 || (*it)->a > 4320);
ra = M_PI / 2880 * (*it)->a; //convert to radians
#if 0
sincos(ra, &sinra, &cosra);
#endif
sinra = sin(ra); cosra = cos(ra);
spacer = preSpacer + m_map.m_ringBreadth * (*it)->lvl;
......
......@@ -34,7 +34,7 @@
#include "builder.h"
#include "Config.h"
#include "fileTree.h"
#include "sincos.h"
#include <cmath>
#include "widget.h"
#define COLOR_GREY QColor::fromHsv( 0, 0, 140 )
......@@ -320,9 +320,6 @@ RadialMap::Map::paint(unsigned int scaleFactor)
if (i == 2)
radius += 5 * scaleFactor;
#if 0
sincos(ra, &sinra, &cosra);
#endif
sinra = sin(ra); cosra = cos(ra);
pos.rx() = cpos.x() + static_cast<int>(cosra * radius);
pos.ry() = cpos.y() - static_cast<int>(sinra * radius);
......@@ -393,15 +390,3 @@ RadialMap::Map::paint(unsigned int scaleFactor)
paint.end();
}
#if 0
#if __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 1
void
sincos(double angleRadians, double *Sin, double *Cos)
{
*Sin = sin(angleRadians);
*Cos = cos(angleRadians);
}
#endif
#endif
/*****************************************************************************
* Copyright (C) 2003-2004 Max Howell <max.howell@methylblue.com> *
* Copyright (C) 2004-2020 Krusader Krew [https://krusader.org] *
* *
* This file is part of Krusader [https://krusader.org]. *
* *
* Krusader is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* Krusader is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Krusader. If not, see [http://www.gnu.org/licenses/]. *
*****************************************************************************/
#ifndef SINCOS_H
#define SINCOS_H
#include <math.h>
#if 0
#if __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 1
void
sincos(double angleRadians, double *Sin, double *Cos);
#endif
#endif
#endif
......@@ -32,8 +32,6 @@
// QtWidgets
#include <QApplication> //sendEvent
#include <KWidgetsAddons/KCursor> //ctor
#include "fileTree.h"
#include "Config.h"
#include "radialMap.h" //constants
......
......@@ -28,20 +28,16 @@
// QtCore
#include <QTimer> //::resizeEvent()
// QtGui
#include <QMouseEvent>
#include <QPainter>
#include <QPaintEvent>
#include <QResizeEvent>
// QtWidgets
#include <QApplication> //QApplication::setOverrideCursor()
#include <QMenu>
#include <KI18n/KLocalizedString>
#include <KIconThemes/KIconEffect>
#include <KIO/DeleteJob>
#include <KIO/JobUiDelegate>
#include <KIOWidgets/KRun>
#include <KWidgetsAddons/KCursor>
#include <KWidgetsAddons/KMessageBox>
#include <KToolInvocation>
......@@ -226,14 +222,8 @@ RadialMap::Widget::mousePressEvent(QMouseEvent *e)
m_tip.hide(); //user expects this
if (!isDir || e->button() == Qt::MidButton) {
#if 0 // TODO: PORTME
KIconEffect::visualActivate(this, rect);
#endif
new KRun(url, this, true); //FIXME see above
} else if (m_focus->file() != m_tree) { //is left mouse button
#if 0 // TODO: PORTME
KIconEffect::visualActivate(this, rect);
#endif
emit activated(url); //activate first, this will cause UI to prepare itself
if (m_focus)
createFromCache(dynamic_cast<const Directory*>(m_focus->file()));
......
......@@ -397,37 +397,7 @@ bool KrInterBriefView::isIndexHidden(const QModelIndex&ndx) const
{
return ndx.column() != 0;
}
#if 0
QRegion KrInterBriefView::visualRegionForSelection(const QItemSelection &selection) const
{
if (selection.isEmpty())
return QRegion();
QRegion selectionRegion;
for (int i = 0; i < selection.count(); ++i) {
QItemSelectionRange range = selection.at(i);
if (!range.isValid())
continue;
QModelIndex leftIndex = range.topLeft();
if (!leftIndex.isValid())
continue;
const QRect leftRect = visualRect(leftIndex);
int top = leftRect.top();
QModelIndex rightIndex = range.bottomRight();
if (!rightIndex.isValid())
continue;
const QRect rightRect = visualRect(rightIndex);
int bottom = rightRect.bottom();
if (top > bottom)
qSwap<int>(top, bottom);
int height = bottom - top + 1;
QRect combined = leftRect | rightRect;
combined.setX(range.left());
selectionRegion += combined;
}
return selectionRegion;
}
#endif
void KrInterBriefView::paintEvent(QPaintEvent *e)
{
QStyleOptionViewItem option = viewOptions();
......
......@@ -952,8 +952,6 @@ void KrView::sortModeUpdated(KrViewProperties::ColumnType sortColumn, bool desce
options &= ~KrViewProperties::Descending;
_properties->sortColumn = sortColumn;
_properties->sortOptions = static_cast<KrViewProperties::SortOptions>(options);
// op()->settingsChanged(KrViewProperties::PropSortMode);
}
bool KrView::drawCurrent() const
......
......@@ -107,16 +107,6 @@ QString KrViewItem::description() const
QPixmap KrViewItem::icon()
{
#if 0
QPixmap *p;
// This is bad - very bad. the function must return a valid reference,
// This is an interface flow - shie please fix it with a function that return QPixmap*
// this way we can return 0 - and do our error checking...
// shie answers: why? what's the difference? if we return an empty pixmap, others can use it as it
// is, without worrying or needing to do error checking. empty pixmap displays nothing
#endif
if (dummyFileItem || !_viewProperties->displayIcons)
return QPixmap();
else return KrView::getIcon(_fileitem, true);
......
......@@ -92,12 +92,7 @@ void ViewActions::allFilter()
{
view()->setFilter(KrViewProperties::All);
}
#if 0
void ViewActions::execFilter()
{
view()->setFilter(KrViewProperties::All);
}
#endif
void ViewActions::customFilter()
{
view()->setFilter(KrViewProperties::Custom);
......
......@@ -24,9 +24,6 @@
#include "krusader.h"
#include "krusaderview.h"
// QtCore
#include <QtGlobal>
#include <KXmlGui/KActionCollection>
KConfig *KrGlobal::config = nullptr;
......@@ -48,16 +45,3 @@ KrPanel *KrGlobal::activePanel()
{
return mainView->activePanel();
}
// void KrGlobal::enableAction(const char *name, bool enable)
// {
// getAction(name)->setEnabled(enable);
// }
//
// QAction* KrGlobal::getAction(const char *name)
// {
// QAction *act = krApp->actionCollection()->action(name);
// if(!act)
// qFatal("no such action: %s", name);
// return act;
// }
......@@ -52,15 +52,11 @@ public:
static QWidget *mainWindow;
static UserAction *userAction;
static JobMan *jobMan;
// static ListPanel *activePanel;
static KrPanel *activePanel();
//HACK - used by [ListerTextArea|KrSearchDialog|LocateDlg]:keyPressEvent()
static QKeySequence copyShortcut;
// static void enableAction(const char *name, bool enable);
// static QAction *getAction(const char *name);
/** Version of saved configuration. Use this to detect configuration updates. */
static const int sConfigVersion = 1;
static int sCurrentConfigVersion;
......
......@@ -97,8 +97,6 @@
// define the static members
Krusader *Krusader::App = nullptr;
QString Krusader::AppName;
// KrBookmarkHandler *Krusader::bookman = 0;
//QTextOStream *Krusader::_krOut = QTextOStream(::stdout);
#ifdef __KJSEMBED__
KrJS *Krusader::js = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment