libs: remove unused lsofui library

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-17 07:14:49 +03:00
parent 25c25215a4
commit 8e835f1f0e
10 changed files with 0 additions and 358 deletions

View file

@ -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

View file

@ -1,6 +1,5 @@
########### next target ###############
add_subdirectory( lsofui )
add_subdirectory( processcore )
add_subdirectory( processui )
add_subdirectory( signalplotter )

View file

@ -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
)

View file

@ -1,45 +0,0 @@
/*
KSysGuard, the KDE System Guard
Copyright (c) 1999 Chris Schlaeger <cs@kde.org>
Copyright (c) 2007 John Tapsell <tapsell@kde.org>
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 <klocale.h>
#include <kdebug.h>
#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
}

View file

@ -1,44 +0,0 @@
/*
KSysGuard, the KDE System Guard
Copyright (c) 2008 John Tapsell <tapsell@kde.org>
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 <kdialog.h>
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

View file

@ -1,53 +0,0 @@
<ui version="4.0" >
<class>KLsofSearchWidget</class>
<widget class="QWidget" name="KLsofSearchWidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>956</width>
<height>686</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="KTreeWidgetSearchLine" name="ktreewidgetsearchline" />
</item>
<item>
<widget class="KLsofWidget" name="klsofwidget" >
<property name="rootIsDecorated" >
<bool>false</bool>
</property>
<column>
<property name="text" >
<string>Stream</string>
</property>
</column>
<column>
<property name="text" >
<string>Type</string>
</property>
</column>
<column>
<property name="text" >
<string>Filename</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KTreeWidgetSearchLine</class>
<extends>KLineEdit</extends>
<header>ktreewidgetsearchline.h</header>
</customwidget>
<customwidget>
<class>KLsofWidget</class>
<extends>QTreeWidget</extends>
<header>lsof.h</header>
</customwidget>
</customwidgets>
<connections/>
</ui>

View file

@ -1,4 +0,0 @@
#!/bin/bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/ksysguardlsofwidgets.pot
rm -f rc.cpp

View file

@ -1,8 +0,0 @@
[Global]
PluginName=KSysGuardLsofWidgets
[KLsofWidget]
Group=KSysGuard (KDE)
ConstructorArgs=(parent)
IncludeFile=lsof.h

View file

@ -1,99 +0,0 @@
#include <QString>
#include <QProcess>
#include <klocale.h>
#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"

View file

@ -1,54 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2007 John Tapsell <tapsell@kde.org>
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 <QtCore/QObject>
#include <QtCore/QProcess>
#include <QtGui/QTreeWidget>
#include <kapplication.h>
#include <kdemacros.h>
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_