diff --git a/CMakeLists.txt b/CMakeLists.txt index 174288d0..e03fae80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,12 +226,6 @@ add_feature_info(rzsz "ZModem support in Konsole" ) -find_program(LSOF_EXECUTABLE lsof) -add_feature_info(lsof - LSOF_EXECUTABLE - "Open files widget (KLsofWidget)" -) - find_program(XKILL_EXECUTABLE xkill) add_feature_info(xkill XKILL_EXECUTABLE diff --git a/libs/ksysguard/CMakeLists.txt b/libs/ksysguard/CMakeLists.txt index 12984100..75c037b6 100644 --- a/libs/ksysguard/CMakeLists.txt +++ b/libs/ksysguard/CMakeLists.txt @@ -1,6 +1,5 @@ ########### next target ############### -add_subdirectory( lsofui ) add_subdirectory( processcore ) add_subdirectory( processui ) add_subdirectory( signalplotter ) diff --git a/libs/ksysguard/lsofui/CMakeLists.txt b/libs/ksysguard/lsofui/CMakeLists.txt deleted file mode 100644 index 51b15c38..00000000 --- a/libs/ksysguard/lsofui/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ - -########### next target ############### - -set(lsofui_LIB_SRCS - lsof.cpp - LsofSearchWidget.ui -) - -add_library(lsofui SHARED ${lsofui_LIB_SRCS}) -target_link_libraries(lsofui KDE4::kio) - -set_target_properties(lsofui PROPERTIES - VERSION ${GENERIC_LIB_VERSION} - SOVERSION ${GENERIC_LIB_SOVERSION} -) - -install( - TARGETS lsofui - EXPORT kdeworkspaceTargets - DESTINATION ${KDE4_LIB_INSTALL_DIR} -) - -########### install files ############### - -install( - FILES lsof.h - DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/ksysguard -) - -kde4_add_widget(ksysguardlsofwidgets_SRCS ksysguardlsof.widgets) - -kde4_add_plugin(ksysguardlsofwidgets ${ksysguardlsofwidgets_SRCS}) - -target_link_libraries(ksysguardlsofwidgets - KDE4::kdecore - ${QT_QTGUI_LIBRARY} - ${QT_QTUITOOLS_LIBRARY} - lsofui -) - -install( - TARGETS ksysguardlsofwidgets - DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}/plugins/designer -) diff --git a/libs/ksysguard/lsofui/LsofSearchWidget.cpp b/libs/ksysguard/lsofui/LsofSearchWidget.cpp deleted file mode 100644 index f91fad70..00000000 --- a/libs/ksysguard/lsofui/LsofSearchWidget.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger - Copyright (c) 2007 John Tapsell - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - -*/ - -#include -#include - -#include "moc_LsofSearchWidget.cpp" -#include "ui_LsofSearchWidget.h" - -LsofSearchWidget::LsofSearchWidget(QWidget* parent, int pid) - : KDialog(parent) -{ - setObjectName("Renice Dialog"); - setModal(true); - setCaption(i18n("Renice Process")); - setButtons(KDialog::Close); - QWidget *widget = new QWidget(this); - setMainWidget(widget); - ui = new Ui_LsofSearchWidget(); - ui->setupUi(widget); - ui->klsofwidget->setPid(pid); - ktreewidgetsearchline -} - diff --git a/libs/ksysguard/lsofui/LsofSearchWidget.h b/libs/ksysguard/lsofui/LsofSearchWidget.h deleted file mode 100644 index 892f791f..00000000 --- a/libs/ksysguard/lsofui/LsofSearchWidget.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 2008 John Tapsell - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -#ifndef _LsofSearchWidget_h_ -#define _LsofSearchWidget_h_ - -#include - -class Ui_LsofSearchWidget; - -/** - * This class creates and handles a simple dialog to change the scheduling - * priority of a process. - */ -class LsofSearchWidget : public KDialog -{ - Q_OBJECT -public: - LsofSearchWidget(QWidget *parent); - -private: - Ui_LsofSearchWidget *ui; -}; - -#endif diff --git a/libs/ksysguard/lsofui/LsofSearchWidget.ui b/libs/ksysguard/lsofui/LsofSearchWidget.ui deleted file mode 100644 index 88054fc1..00000000 --- a/libs/ksysguard/lsofui/LsofSearchWidget.ui +++ /dev/null @@ -1,53 +0,0 @@ - - KLsofSearchWidget - - - - 0 - 0 - 956 - 686 - - - - - - - - - - false - - - - Stream - - - - - Type - - - - - Filename - - - - - - - - - KTreeWidgetSearchLine - KLineEdit -
ktreewidgetsearchline.h
-
- - KLsofWidget - QTreeWidget -
lsof.h
-
-
- -
diff --git a/libs/ksysguard/lsofui/Messages.sh b/libs/ksysguard/lsofui/Messages.sh deleted file mode 100755 index e84d92d3..00000000 --- a/libs/ksysguard/lsofui/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -$EXTRACTRC *.ui >> rc.cpp -$XGETTEXT *.cpp -o $podir/ksysguardlsofwidgets.pot -rm -f rc.cpp diff --git a/libs/ksysguard/lsofui/ksysguardlsof.widgets b/libs/ksysguard/lsofui/ksysguardlsof.widgets deleted file mode 100644 index 5673bee5..00000000 --- a/libs/ksysguard/lsofui/ksysguardlsof.widgets +++ /dev/null @@ -1,8 +0,0 @@ -[Global] -PluginName=KSysGuardLsofWidgets - -[KLsofWidget] -Group=KSysGuard (KDE) -ConstructorArgs=(parent) -IncludeFile=lsof.h - diff --git a/libs/ksysguard/lsofui/lsof.cpp b/libs/ksysguard/lsofui/lsof.cpp deleted file mode 100644 index a43af349..00000000 --- a/libs/ksysguard/lsofui/lsof.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include -#include - -#include "lsof.h" - -struct KLsofWidgetPrivate -{ - qlonglong pid; - QProcess *process; -}; - -KLsofWidget::KLsofWidget(QWidget *parent) - : QTreeWidget(parent), d(new KLsofWidgetPrivate()) -{ - d->pid = -1; - setColumnCount(3); - setUniformRowHeights(true); - setRootIsDecorated(false); - setItemsExpandable(false); - setSortingEnabled(true); - setAllColumnsShowFocus(true); - setHeaderLabels(QStringList() << i18nc("Short for File Descriptor", "FD") << i18n("Type") << i18n("Object")); - d->process = new QProcess(this); - connect(d->process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus))); -} - -KLsofWidget::~KLsofWidget() -{ - delete d; -} - -qlonglong KLsofWidget::pid() const -{ - return d->pid; -} - -void KLsofWidget::setPid(qlonglong pid) -{ - d->pid = pid; - update(); -} - -bool KLsofWidget::update() -{ - clear(); - QStringList args; - d->process->waitForFinished(); - args << "-Fftn"; - if (d->pid > 0) { - args << ("-p" + QString::number(d->pid)); - } - d->process->start("lsof", args); - return true; -} - -void KLsofWidget::finished(int exitCode, QProcess::ExitStatus exitStatus) -{ - Q_UNUSED(exitCode); - Q_UNUSED(exitStatus); - - char buf[1024]; - QTreeWidgetItem *process = NULL; - while (true) { - ::memset(buf, '\0', sizeof(buf) * sizeof(char)); - qint64 lineLength = d->process->readLine(buf, sizeof(buf)); - - if (lineLength <= 0) { - break; - } - if (buf[lineLength-1] == '\n') { - lineLength--; - } - - switch(buf[0]) { - /* Process related stuff */ - case 'f': { - process = new QTreeWidgetItem(this); - process->setText(0,QString::fromUtf8(buf+1, lineLength - 1)); - break; - } - case 't': { - if (process) - process->setText(1,QString::fromUtf8(buf+1, lineLength - 1)); - break; - } - case 'n': { - if (process) - process->setText(2,QString::fromUtf8(buf+1, lineLength - 1)); - break; - } - default: { - break; - } - } - } -} - -#include "moc_lsof.cpp" diff --git a/libs/ksysguard/lsofui/lsof.h b/libs/ksysguard/lsofui/lsof.h deleted file mode 100644 index 59803acd..00000000 --- a/libs/ksysguard/lsofui/lsof.h +++ /dev/null @@ -1,54 +0,0 @@ -/* This file is part of the KDE project - - Copyright (C) 2007 John Tapsell - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -#ifndef LSOFWIDGET_H_ -#define LSOFWIDGET_H_ - -#include -#include -#include -#include -#include - -struct KLsofWidgetPrivate; - -class KDE_EXPORT KLsofWidget : public QTreeWidget -{ - Q_OBJECT - Q_PROPERTY(qlonglong pid READ pid WRITE setPid) -public: - KLsofWidget(QWidget *parent = NULL); - ~KLsofWidget(); - - bool update(); - -public Q_SLOTS: - qlonglong pid() const; - void setPid(qlonglong pid); - -private Q_SLOTS: - /* For QProcess *process */ - void finished(int exitCode, QProcess::ExitStatus exitStatus); -private: - KLsofWidgetPrivate* const d; -}; - -#endif // LSOFWIDGET_H_