diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-08-10 11:56:43 -0300 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-08-12 19:30:46 +0200 |
commit | 85fb916b9b50ded3a5072181d20463428f4a138a (patch) | |
tree | 097a9868915100dc896b85bb5c88fd75ae34333a /src/imports | |
parent | 2ddded8a0d860b10792e34943b72f50a64c2cc4f (diff) |
Remove QStorageInfo in favor of the QtCore replacement
Change-Id: I0a22820d2f5ee554d2929ba7332c8a4e143121ce
Discussed-in: http://lists.qt-project.org/pipermail/development/2014-August/017938.html
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/systeminfo/qdeclarativestorageinfo.cpp | 157 | ||||
-rw-r--r-- | src/imports/systeminfo/qdeclarativestorageinfo_p.h | 104 | ||||
-rw-r--r-- | src/imports/systeminfo/qsysteminfo.cpp | 2 | ||||
-rw-r--r-- | src/imports/systeminfo/systeminfo.pro | 4 |
4 files changed, 1 insertions, 266 deletions
diff --git a/src/imports/systeminfo/qdeclarativestorageinfo.cpp b/src/imports/systeminfo/qdeclarativestorageinfo.cpp deleted file mode 100644 index 2b5370ab..00000000 --- a/src/imports/systeminfo/qdeclarativestorageinfo.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSystems module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qdeclarativestorageinfo_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype StorageInfo - \instantiates QDeclarativeStorageInfo - \inqmlmodule QtSystemInfo - \ingroup qml-systeminfo - \brief The StorageInfo element provides various information about the storage system. -*/ - -/*! - \internal -*/ -QDeclarativeStorageInfo::QDeclarativeStorageInfo(QObject *parent) - : QObject(parent) - , storageInfo(new QStorageInfo(this)) - , isMonitorAllLogicalDrives(false) -{ -} - -/*! - \internal - */ -QDeclarativeStorageInfo::~QDeclarativeStorageInfo() -{ -} - -/*! - \qmlproperty bool StorageInfo::monitorAllLogicalDrives - - This property triggers the active monitoring of all available logical drives. - */ -bool QDeclarativeStorageInfo::monitorAllLogicalDrives() const -{ - return isMonitorAllLogicalDrives; -} - -void QDeclarativeStorageInfo::setMonitorAllLogicalDrives(bool monitor) -{ - if (monitor != isMonitorAllLogicalDrives) { - isMonitorAllLogicalDrives = monitor; - if (monitor) { - connect(storageInfo, SIGNAL(logicalDriveChanged(QString,bool)), - this, SIGNAL(logicalDriveChanged(QString,bool))); - } else { - disconnect(storageInfo, SIGNAL(logicalDriveChanged(QString,bool)), - this, SIGNAL(logicalDriveChanged(QString,bool))); - } - emit monitorAllLogicalDrivesChanged(); - } -} - -/*! - \qmlproperty stringlist StorageInfo::allLogicalDrives - - This property holds a list of all the available logical drives. -*/ -QStringList QDeclarativeStorageInfo::allLogicalDrives() const -{ - return storageInfo->allLogicalDrives(); -} - -/*! - \qmlmethod qlonglong StorageInfo::availableDiskSpace(string drive) - - Returns the available free space on the \a drive, in bytes. -1 is returned if the drive doesn't - exist, or the information is not available. -*/ -qlonglong QDeclarativeStorageInfo::availableDiskSpace(const QString &drive) const -{ - return storageInfo->availableDiskSpace(drive); -} - -/*! - \qmlmethod qlonglong StorageInfo::totalDiskSpace(string drive) - - Returns the total space of the \a drive, in bytes. -1 is returned if the drive doesn't exist, - or the information is not available. -*/ -qlonglong QDeclarativeStorageInfo::totalDiskSpace(const QString &drive) const -{ - return storageInfo->totalDiskSpace(drive); -} - -/*! - \qmlmethod qlonglong StorageInfo::uriForDrive(string drive) - - Returns the URI, or unique identifier for the given \a drive. If the drive doesn't exist, or the - information is not available, an empty string is returned. -*/ -QString QDeclarativeStorageInfo::uriForDrive(const QString &drive) const -{ - return storageInfo->uriForDrive(drive); -} - -/*! - \qmlmethod DriveType StorageInfo::driveType(string drive) - - Returns the type of the given \a drive. Possible values are: - \list - \li StorageInfo.UnknownDrive - Drive type unknown. - \li StorageInfo.InternalDrive - Internal mass storage drive, e.g. hard drive. - \li StorageInfo.RemovableDrive - Removable drive, e.g. memory card. - \li StorageInfo.RemoteDrive - Network drive. - \li StorageInfo.CdromDrive - CD-ROM. - \li StorageInfo.RamDrive - Virtual drive made in RAM memory. - \endlist -*/ -int QDeclarativeStorageInfo::driveType(const QString &drive) const -{ - return storageInfo->driveType(drive); -} - -QT_END_NAMESPACE diff --git a/src/imports/systeminfo/qdeclarativestorageinfo_p.h b/src/imports/systeminfo/qdeclarativestorageinfo_p.h deleted file mode 100644 index d836269f..00000000 --- a/src/imports/systeminfo/qdeclarativestorageinfo_p.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSystems module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#ifndef QDECLARATIVESTORAGEINFO_P_H -#define QDECLARATIVESTORAGEINFO_P_H - -#include <qstorageinfo.h> - -QT_BEGIN_NAMESPACE - -class QDeclarativeStorageInfo : public QObject -{ - Q_OBJECT - - Q_ENUMS(DriveType) - - Q_PROPERTY(QStringList allLogicalDrives READ allLogicalDrives NOTIFY logicalDriveChanged) - Q_PROPERTY(bool monitorAllLogicalDrives READ monitorAllLogicalDrives WRITE setMonitorAllLogicalDrives NOTIFY monitorAllLogicalDrivesChanged) - -public: - enum DriveType { - UnknownDrive = QStorageInfo::UnknownDrive, - InternalDrive = QStorageInfo::InternalDrive, - RemovableDrive = QStorageInfo::RemovableDrive, - RemoteDrive = QStorageInfo::RemoteDrive, - CdromDrive = QStorageInfo::CdromDrive, - RamDrive = QStorageInfo::RamDrive - }; - - QDeclarativeStorageInfo(QObject *parent = 0); - virtual ~QDeclarativeStorageInfo(); - - bool monitorAllLogicalDrives() const; - void setMonitorAllLogicalDrives(bool monitor); - QStringList allLogicalDrives() const; - - Q_INVOKABLE qlonglong availableDiskSpace(const QString &drive) const; - Q_INVOKABLE qlonglong totalDiskSpace(const QString &drive) const; - Q_INVOKABLE QString uriForDrive(const QString &drive) const; - Q_INVOKABLE int driveType(const QString &drive) const; - -Q_SIGNALS: - void monitorAllLogicalDrivesChanged(); - - void logicalDriveChanged(const QString &drive, bool added); - -private: - QStorageInfo *storageInfo; - - bool isMonitorAllLogicalDrives; -}; - -QT_END_NAMESPACE - -#endif // QDECLARATIVESTORAGEINFO_P_H diff --git a/src/imports/systeminfo/qsysteminfo.cpp b/src/imports/systeminfo/qsysteminfo.cpp index c3fb9bbd..93f14690 100644 --- a/src/imports/systeminfo/qsysteminfo.cpp +++ b/src/imports/systeminfo/qsysteminfo.cpp @@ -45,7 +45,6 @@ #include "qdeclarativedeviceinfo_p.h" #include "qdeclarativenetworkinfo_p.h" #include <qscreensaver.h> -#include "qdeclarativestorageinfo_p.h" QT_BEGIN_NAMESPACE @@ -64,7 +63,6 @@ public: qmlRegisterType<QDeclarativeDeviceInfo>(uri, major, minor, "DeviceInfo"); qmlRegisterType<QDeclarativeNetworkInfo>(uri, major, minor, "NetworkInfo"); qmlRegisterType<QScreenSaver>(uri, major, minor, "ScreenSaver"); - qmlRegisterType<QDeclarativeStorageInfo>(uri, major, minor, "StorageInfo"); } }; diff --git a/src/imports/systeminfo/systeminfo.pro b/src/imports/systeminfo/systeminfo.pro index a3ce2ae3..f14c6ea2 100644 --- a/src/imports/systeminfo/systeminfo.pro +++ b/src/imports/systeminfo/systeminfo.pro @@ -3,13 +3,11 @@ QT -= gui HEADERS += \ qdeclarativedeviceinfo_p.h \ - qdeclarativenetworkinfo_p.h \ - qdeclarativestorageinfo_p.h + qdeclarativenetworkinfo_p.h SOURCES += \ qdeclarativedeviceinfo.cpp \ qdeclarativenetworkinfo.cpp \ - qdeclarativestorageinfo.cpp \ qsysteminfo.cpp load(qml_plugin) |