Replace std::array with std::vector

Less efficient but helps with keeping ABI stable
This commit is contained in:
Andrius Štikonas 2018-04-05 21:52:17 +01:00
parent 54be18e8ad
commit 63cea60ff1
6 changed files with 9 additions and 12 deletions

View File

@ -15,8 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
*************************************************************************/
#if !defined(KPMCORE_DEVICE_H)
#ifndef KPMCORE_DEVICE_H
#define KPMCORE_DEVICE_H
#include "util/libpartitionmanagerexport.h"

View File

@ -44,7 +44,7 @@ FileSystem::CommandSupportType btrfs::m_UpdateUUID = FileSystem::cmdSupportNone;
FileSystem::CommandSupportType btrfs::m_GetUUID = FileSystem::cmdSupportNone;
btrfs::btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Btrfs)
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Btrfs)
{
}

View File

@ -36,7 +36,7 @@
#include <QStandardPaths>
#include <QStorageInfo>
const std::array< QColor, FileSystem::__lastType > FileSystem::defaultColorCode =
const std::vector<QColor> FileSystem::defaultColorCode =
{
{
QColor( 220,205,175 ), // unknown

View File

@ -28,7 +28,7 @@
#include <QtGlobal>
#include <QUrl>
#include <array>
#include <vector>
class QColor;
class QValidator;
@ -57,7 +57,7 @@ public:
};
/** Supported FileSystem types */
enum Type {
enum Type : int {
Unknown = 0,
Extended = 1,
@ -101,7 +101,7 @@ public:
cmdSupportBackend = 4 /**< supported by the backend */
};
static const std::array< QColor, __lastType > defaultColorCode;
static const std::vector<QColor> defaultColorCode;
Q_DECLARE_FLAGS(CommandSupportTypes, CommandSupportType)

View File

@ -71,7 +71,7 @@ void PartWidget::updateChildren()
}
}
void PartWidget::setFileSystemColorCode(const std::array< QColor, FileSystem::__lastType >& colorCode)
void PartWidget::setFileSystemColorCode(const std::vector<QColor>& colorCode)
{
m_fileSystemColorCode = colorCode;
repaint();

View File

@ -26,8 +26,6 @@
#include <QColor>
#include <array>
class Partition;
class QPaintEvent;
@ -63,7 +61,7 @@ public:
return m_Partition; /**< @return the widget's Partition */
}
void setFileSystemColorCode( const std::array< QColor, FileSystem::__lastType >& colorCode );
void setFileSystemColorCode( const std::vector<QColor>& colorCode );
protected:
void paintEvent(QPaintEvent* event);
@ -76,7 +74,7 @@ protected:
private:
Partition* m_Partition;
bool m_Active;
std::array< QColor, FileSystem::__lastType > m_fileSystemColorCode;
std::vector<QColor> m_fileSystemColorCode;
};
#endif