From 1e52f59fd48ebbea728fe0ec4f07726934fbb4a5 Mon Sep 17 00:00:00 2001 From: sss Date: Fri, 9 Apr 2021 23:56:39 +0300 Subject: moved patches to proper location --- packages/patches/kcollectd_add_path_argument.patch | 71 ---------------------- packages/patches/kcollectd_use_splitter.patch | 39 ------------ share/guile/site/kcollectd_add_path_argument.patch | 71 ++++++++++++++++++++++ share/guile/site/kcollectd_use_splitter.patch | 39 ++++++++++++ 4 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 packages/patches/kcollectd_add_path_argument.patch delete mode 100644 packages/patches/kcollectd_use_splitter.patch create mode 100644 share/guile/site/kcollectd_add_path_argument.patch create mode 100644 share/guile/site/kcollectd_use_splitter.patch diff --git a/packages/patches/kcollectd_add_path_argument.patch b/packages/patches/kcollectd_add_path_argument.patch deleted file mode 100644 index b611d1e..0000000 --- a/packages/patches/kcollectd_add_path_argument.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/kcollectd/gui.cc b/kcollectd/gui.cc -index a344f47..df3e442 100644 ---- a/kcollectd/gui.cc -+++ b/kcollectd/gui.cc -@@ -59,12 +59,14 @@ - - #include "drag_pixmap.xpm" - --#ifndef RRD_BASEDIR -+/*#ifndef RRD_BASEDIR - #define RRD_BASEDIR "/var/lib/collectd/rrd" --#endif -+#endif */ - - #define I18N_NOOP(text) text - -+extern QString rrd_path; -+ - static struct { - KStandardAction::StandardAction actionType; - const char *name; -@@ -372,7 +374,7 @@ KCollectdGui::KCollectdGui(QWidget *parent) - menuBar()->addMenu(helpMenu()); - - // build rrd-tree -- get_rrds(RRD_BASEDIR, listview()); -+ get_rrds(rrd_path.toUtf8().data(), listview()); - } - - KCollectdGui::~KCollectdGui() {} -diff --git a/kcollectd/kcollectd.cc b/kcollectd/kcollectd.cc -index cccd3df..1f3b439 100644 ---- a/kcollectd/kcollectd.cc -+++ b/kcollectd/kcollectd.cc -@@ -37,6 +37,8 @@ - - #include "gui.h" - -+QString rrd_path = ""; -+ - int main(int argc, char **argv) { - using namespace boost::filesystem; - -@@ -64,9 +66,18 @@ int main(int argc, char **argv) { - parser.addVersionOption(); - - parser.addPositionalArgument("+[file]", i18n("A kcollectd-file to open")); -+ parser.addPositionalArgument("path", i18n("rrd path")); - parser.process(application); - - const QStringList args = parser.positionalArguments(); -+ if (args.size() >= 2) -+ { -+ rrd_path = args.at(1); -+ } -+ else -+ { -+ rrd_path = "/var/lib/collectd/rrd"; -+ } - try { - if (application.isSessionRestored()) { - kRestoreMainWindows(); -@@ -81,7 +92,7 @@ int main(int argc, char **argv) { - } catch (const std::exception &e) { - KMessageBox::error(0, i18n("Failed to read collectd-structure at \'%1\'\n" - "Terminating.", -- QString(RRD_BASEDIR))); -+ rrd_path)); - exit(1); - } - diff --git a/packages/patches/kcollectd_use_splitter.patch b/packages/patches/kcollectd_use_splitter.patch deleted file mode 100644 index 2bdf606..0000000 --- a/packages/patches/kcollectd_use_splitter.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/kcollectd/gui.cc b/kcollectd/gui.cc -index df3e442..8c6f61f 100644 ---- a/kcollectd/gui.cc -+++ b/kcollectd/gui.cc -@@ -43,6 +43,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -283,7 +284,11 @@ KCollectdGui::KCollectdGui(QWidget *parent) - QWidget *main_widget = new QWidget(this); - setCentralWidget(main_widget); - -- QHBoxLayout *hbox = new QHBoxLayout(main_widget); -+ QHBoxLayout *main_layout = new QHBoxLayout; -+ -+ main_widget->setLayout(main_layout); -+ -+ QSplitter *hbox = new QSplitter(Qt::Horizontal); - listview_ = new QTreeWidget; - listview_->setColumnCount(1); - listview_->setHeaderLabels(QStringList(i18n("Sensordata"))); -@@ -292,7 +297,12 @@ KCollectdGui::KCollectdGui(QWidget *parent) - hbox->addWidget(listview_); - - vbox = new QVBoxLayout; -- hbox->addLayout(vbox); -+ { -+ QWidget *fck = new QWidget; -+ fck->setLayout(vbox); -+ hbox->addWidget(fck); -+ main_layout->addWidget(hbox); -+ } - graph = new Graph; - vbox->addWidget(graph); - diff --git a/share/guile/site/kcollectd_add_path_argument.patch b/share/guile/site/kcollectd_add_path_argument.patch new file mode 100644 index 0000000..b611d1e --- /dev/null +++ b/share/guile/site/kcollectd_add_path_argument.patch @@ -0,0 +1,71 @@ +diff --git a/kcollectd/gui.cc b/kcollectd/gui.cc +index a344f47..df3e442 100644 +--- a/kcollectd/gui.cc ++++ b/kcollectd/gui.cc +@@ -59,12 +59,14 @@ + + #include "drag_pixmap.xpm" + +-#ifndef RRD_BASEDIR ++/*#ifndef RRD_BASEDIR + #define RRD_BASEDIR "/var/lib/collectd/rrd" +-#endif ++#endif */ + + #define I18N_NOOP(text) text + ++extern QString rrd_path; ++ + static struct { + KStandardAction::StandardAction actionType; + const char *name; +@@ -372,7 +374,7 @@ KCollectdGui::KCollectdGui(QWidget *parent) + menuBar()->addMenu(helpMenu()); + + // build rrd-tree +- get_rrds(RRD_BASEDIR, listview()); ++ get_rrds(rrd_path.toUtf8().data(), listview()); + } + + KCollectdGui::~KCollectdGui() {} +diff --git a/kcollectd/kcollectd.cc b/kcollectd/kcollectd.cc +index cccd3df..1f3b439 100644 +--- a/kcollectd/kcollectd.cc ++++ b/kcollectd/kcollectd.cc +@@ -37,6 +37,8 @@ + + #include "gui.h" + ++QString rrd_path = ""; ++ + int main(int argc, char **argv) { + using namespace boost::filesystem; + +@@ -64,9 +66,18 @@ int main(int argc, char **argv) { + parser.addVersionOption(); + + parser.addPositionalArgument("+[file]", i18n("A kcollectd-file to open")); ++ parser.addPositionalArgument("path", i18n("rrd path")); + parser.process(application); + + const QStringList args = parser.positionalArguments(); ++ if (args.size() >= 2) ++ { ++ rrd_path = args.at(1); ++ } ++ else ++ { ++ rrd_path = "/var/lib/collectd/rrd"; ++ } + try { + if (application.isSessionRestored()) { + kRestoreMainWindows(); +@@ -81,7 +92,7 @@ int main(int argc, char **argv) { + } catch (const std::exception &e) { + KMessageBox::error(0, i18n("Failed to read collectd-structure at \'%1\'\n" + "Terminating.", +- QString(RRD_BASEDIR))); ++ rrd_path)); + exit(1); + } + diff --git a/share/guile/site/kcollectd_use_splitter.patch b/share/guile/site/kcollectd_use_splitter.patch new file mode 100644 index 0000000..2bdf606 --- /dev/null +++ b/share/guile/site/kcollectd_use_splitter.patch @@ -0,0 +1,39 @@ +diff --git a/kcollectd/gui.cc b/kcollectd/gui.cc +index df3e442..8c6f61f 100644 +--- a/kcollectd/gui.cc ++++ b/kcollectd/gui.cc +@@ -43,6 +43,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -283,7 +284,11 @@ KCollectdGui::KCollectdGui(QWidget *parent) + QWidget *main_widget = new QWidget(this); + setCentralWidget(main_widget); + +- QHBoxLayout *hbox = new QHBoxLayout(main_widget); ++ QHBoxLayout *main_layout = new QHBoxLayout; ++ ++ main_widget->setLayout(main_layout); ++ ++ QSplitter *hbox = new QSplitter(Qt::Horizontal); + listview_ = new QTreeWidget; + listview_->setColumnCount(1); + listview_->setHeaderLabels(QStringList(i18n("Sensordata"))); +@@ -292,7 +297,12 @@ KCollectdGui::KCollectdGui(QWidget *parent) + hbox->addWidget(listview_); + + vbox = new QVBoxLayout; +- hbox->addLayout(vbox); ++ { ++ QWidget *fck = new QWidget; ++ fck->setLayout(vbox); ++ hbox->addWidget(fck); ++ main_layout->addWidget(hbox); ++ } + graph = new Graph; + vbox->addWidget(graph); + -- cgit v1.2.3