This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

SysStat: license updated & unused files removed

  • Loading branch information...
1 parent 12f8ac0 commit b0b6a30c23a9d302dd3cc7a33997ac0447459f9a @kuzmas kuzmas committed Dec 1, 2012
@@ -1,159 +0,0 @@
-/*************
-**
-** Project: Qt-based interface to system statistics (libsysstat)
-** Author: Copyright (C) 2009 - 2012 Kuzma Shapran <Kuzma.Shapran@gmail.com>
-** License: LGPLv3
-**
-** This file is part of SysStat library.
-**
-** This library is free software; you can redistribute it and/or modify it
-** under the terms of the GNU Lesser General Public License as published by
-** the Free Software Foundation; either version 3 of the License, or any
-** later version. This work 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 Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public License
-** along with the library.
-** If not, see <http://www.gnu.org/licenses/lgpl.html>.
-**
-*************/
-
-
-#include "cpufreqstat.hpp"
-#include "cpufreqstat_p.hpp"
-
-
-namespace SysStat {
-
-CpuFreqStatPrivate::CpuFreqStatPrivate(CpuFreqStat *parent)
- : BaseStatPrivate(parent)
-{
- m_source = defaultSource();
-
- connect(m_timer, SIGNAL(timeout()), SLOT(timeout()));
-
- updateSources();
-}
-
-CpuFreqStatPrivate::~CpuFreqStatPrivate()
-{
-}
-
-void CpuFreqStatPrivate::addSource(const QString &source)
-{
- bool ok;
-
- uint min = readAllFile(qPrintable(QString("/sys/devices/system/cpu/%1/cpufreq/scaling_max_freq").arg(source))).toUInt(&ok);
- if (ok)
- {
- uint max = readAllFile(qPrintable(QString("/sys/devices/system/cpu/%1/cpufreq/scaling_max_freq").arg(source))).toUInt(&ok);
- if (ok)
- {
- m_sources.append(source);
- m_bounds[source] = qMakePair(min, max);
- }
- }
-}
-
-void CpuFreqStatPrivate::updateSources(void)
-{
- m_sources.clear();
- m_bounds.clear();
-
- bool ok;
-
- foreach (QString range, readAllFile("/sys/devices/system/cpu/online").split(QChar(','), QString::SkipEmptyParts))
- {
- int dash = range.indexOf('-');
- if (dash != -1)
- {
- uint min = range.left(dash).toUInt(&ok);
- if (ok)
- {
- uint max = range.mid(dash + 1).toUInt(&ok);
- if (ok)
- for (uint number = min; number <= max; ++number)
- addSource(QString("cpu%1").arg(number));
- }
- }
- else
- {
- uint number = range.toUInt(&ok);
- if (ok)
- addSource(QString("cpu%1").arg(number));
- }
- }
-}
-
-void CpuFreqStatPrivate::timeout(void)
-{
- bool ok;
-
- uint cur = readAllFile(qPrintable(QString("/sys/devices/system/cpu/%1/cpufreq/scaling_cur_freq").arg(m_source))).toUInt(&ok);
-
- if (ok)
- emit update(cur);
-}
-
-QString CpuFreqStatPrivate::defaultSource(void)
-{
- if (m_sources.isEmpty())
- updateSources();
-
- if (!m_sources.isEmpty())
- return m_sources[0];
-
- return QString();
-}
-
-uint CpuFreqStatPrivate::minFreq(const QString &source) const
-{
- Bounds::ConstIterator I = m_bounds.constFind(source);
-
- if (I != m_bounds.constEnd())
- return I.value().first;
-
- return 0;
-}
-
-uint CpuFreqStatPrivate::maxFreq(const QString &source) const
-{
- Bounds::ConstIterator I = m_bounds.constFind(source);
-
- if (I != m_bounds.constEnd())
- return I.value().second;
-
- return 0;
-}
-
-CpuFreqStat::CpuFreqStat(QObject *parent)
- : BaseStat(parent)
-{
- impl = new CpuFreqStatPrivate(this);
- baseimpl = impl;
-
- connect(impl, SIGNAL(update(uint)), this, SIGNAL(update(uint)));
-}
-
-CpuFreqStat::~CpuFreqStat()
-{
-}
-
-void CpuFreqStat::updateSources(void)
-{
- dynamic_cast<CpuFreqStatPrivate*>(impl)->updateSources();
-}
-
-uint CpuFreqStat::minFreq(const QString &source) const
-{
- return dynamic_cast<CpuFreqStatPrivate*>(impl)->minFreq(source);
-}
-
-uint CpuFreqStat::maxFreq(const QString &source) const
-{
- return dynamic_cast<CpuFreqStatPrivate*>(impl)->maxFreq(source);
-}
-
-}
@@ -1,64 +0,0 @@
-/*************
-**
-** Project: Qt-based interface to system statistics (libsysstat)
-** Author: Copyright (C) 2009 - 2012 Kuzma Shapran <Kuzma.Shapran@gmail.com>
-** License: LGPLv3
-**
-** This file is part of SysStat library.
-**
-** This library is free software; you can redistribute it and/or modify it
-** under the terms of the GNU Lesser General Public License as published by
-** the Free Software Foundation; either version 3 of the License, or any
-** later version. This work 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 Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public License
-** along with the library.
-** If not, see <http://www.gnu.org/licenses/lgpl.html>.
-**
-*************/
-
-
-#ifndef LIBSYSSTAT__CPU_FREQ_STAT__INCLUDED
-#define LIBSYSSTAT__CPU_FREQ_STAT__INCLUDED
-
-
-#include <QtCore/QObject>
-#include <QtCore/QtGlobal>
-#include <QtCore/QString>
-
-#include "sysstat_global.hpp"
-#include "basestat.hpp"
-
-
-namespace SysStat {
-
-class CpuFreqStatPrivate;
-
-class SYSSTATSHARED_EXPORT CpuFreqStat : public BaseStat
-{
- Q_OBJECT
-
-public:
- CpuFreqStat(QObject *parent = NULL);
- ~CpuFreqStat();
-
- QStringList sources(void) const;
-
- void updateSources(void);
-
- uint minFreq(const QString &source) const;
- uint maxFreq(const QString &source) const;
-
-signals:
- void update(uint freq);
-
-protected:
- CpuFreqStatPrivate* impl;
-};
-
-}
-
-#endif //LIBSYSSTAT__CPU_FREQ_STAT__INCLUDED
@@ -1,69 +0,0 @@
-/*************
-**
-** Project: Qt-based interface to system statistics (libsysstat)
-** Author: Copyright (C) 2009 - 2012 Kuzma Shapran <Kuzma.Shapran@gmail.com>
-** License: LGPLv3
-**
-** This file is part of SysStat library.
-**
-** This library is free software; you can redistribute it and/or modify it
-** under the terms of the GNU Lesser General Public License as published by
-** the Free Software Foundation; either version 3 of the License, or any
-** later version. This work 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 Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public License
-** along with the library.
-** If not, see <http://www.gnu.org/licenses/lgpl.html>.
-**
-*************/
-
-
-#ifndef LIBSYSSTAT__CPU_FREQ_STAT__PRIVATE__INCLUDED
-#define LIBSYSSTAT__CPU_FREQ_STAT__PRIVATE__INCLUDED
-
-
-#include <QtCore/QObject>
-#include <QtCore/QtGlobal>
-#include <QtCore/QMap>
-#include <QtCore/QPair>
-
-#include "basestat_p.hpp"
-#include "cpufreqstat.hpp"
-
-
-namespace SysStat {
-
-class CpuFreqStatPrivate : public BaseStatPrivate
-{
- Q_OBJECT
-
-public:
- CpuFreqStatPrivate(CpuFreqStat *parent = NULL);
- ~CpuFreqStatPrivate();
-
- void updateSources(void);
-
- uint minFreq(const QString &source) const;
- uint maxFreq(const QString &source) const;
-
-signals:
- void update(uint freq);
-
-private slots:
- void timeout(void);
-
-private:
- QString defaultSource(void);
-
- typedef QMap<QString, QPair<uint, uint> > Bounds;
- Bounds m_bounds;
-
- void addSource(const QString &source);
-};
-
-}
-
-#endif //LIBSYSSTAT__CPU_FREQ_STAT__PRIVATE__INCLUDED
@@ -1,3 +1,30 @@
+/* BEGIN_COMMON_COPYRIGHT_HEADER
+ * (c)LGPL2+
+ *
+ * Razor - a lightweight, Qt based, desktop toolset
+ * http://razor-qt.org
+ *
+ * Copyright: 2012 Razor team
+ * Authors:
+ * Kuzma Shapran <kuzma.shapran@gmail.com>
+ *
+ * This program or library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ * END_COMMON_COPYRIGHT_HEADER */
+
#include <QtCore/QRegExp>
#include <QtCore/qmath.h>
@@ -1,5 +1,32 @@
-#ifndef COLOURSELECTOR_H
-#define COLOURSELECTOR_H
+/* BEGIN_COMMON_COPYRIGHT_HEADER
+ * (c)LGPL2+
+ *
+ * Razor - a lightweight, Qt based, desktop toolset
+ * http://razor-qt.org
+ *
+ * Copyright: 2012 Razor team
+ * Authors:
+ * Kuzma Shapran <kuzma.shapran@gmail.com>
+ *
+ * This program or library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ * END_COMMON_COPYRIGHT_HEADER */
+
+#ifndef RAZORSYSSTATUTILS_HPP
+#define RAZORSYSSTATUTILS_HPP
#include <QtCore/QString>
@@ -11,4 +38,4 @@ int netSpeedFromString(QString value);
}
-#endif // COLOURSELECTOR_H
+#endif // RAZORSYSSTATUTILS_HPP

0 comments on commit b0b6a30

Please sign in to comment.