- the generic (enum-based) setupButton() can handle all four
of the buttons, so setupLinks() can go away. Only the
(re)translation of the text on the button needs to be
done, so move that to the main RETRANSLATE.
- Handle buttons and their URL-opening in a more
general way with an enum; drop existing three-boot
method and special setupDonateButton()
- Doesn't compile because consumers haven't changed.
Require KCoreAddons. This is one of the KDE Frameworks, small
and lightweight libraries adding functionality on top of Qt.
Since lots of **other** parts of Calamares require KDE Frameworks,
including the partitioning module, requiring a tier-1 for
basic functionality seems reasonable.
This brings:
- using KPluginLoader instead of an ancient fork
- availability of KMacroExpander everywhere
- kaboutdata (needed for KCrash anyway)
- kjobs (need to look into using those as a base for Calamares jobs)
Currently, the `bytesToSectors()` function rounds a partition size to the
nearest MiB unit, which may lead to inconsistencies when a partition
is expected to only be a few KiB's.
This patch changes the behaviour of `bytesToSectors()` so that it aligns
on sector size, without rounding the partition size to a multiple of
1MiB.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Currently, all size units are expressed as KiB, MiB or GiB (resp. 2^10,
2^20 or 2^30).
In order to maximize compatibility and consistent results with other
partitioning tools, this commit adds support for sizes expressed as KB,
MB or GB (resp. 10^3, 10^6 or 10^9).
This change won't affect existing users, it simply adds a new option
that wasn't previously handled.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
- this is not entirely straightfoward, since we need
different constructor arguments for the objects
Calamares creates (no QVariantList& args, in particular).
Implement our own registerPlugin() and createInstance()
for that.
- work around a bug in K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY
As the config files integer are now of type `QVariant::LongLong` instead
of `QVariant::Int`, requirements relying on this type were not parsed
correctly.
This patch fixes this, and adds an option to the python conversion to
take into account `QVariant::LongLong` types.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Currently, a number of configuration parsing-related functions and
classes use only `int` type for dealing with integers. Should the user
need a bigger integer value, this would result in an erroneous value
being used (`0`), as the correct value would overflow the 32-bits type.
In order to prevent these overflow, this patch replaces `int` with
`qint64` in the following functions & classes :
* CalamaresUtils::yamlScalarToVariant()
* CalamaresUtils::getInteger
* NamedSuffix
* PartitionSize
This way, sizes or other integer values greater than 2^31 (for signed
types) can be used.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
When the rootfs partition is read-only, mount points for the other
partitions cannot be created, therefore they need to be created in a
tmpfs, already mounted somewhere in `/`.
However, the extra mounts are only mounted at the end, which causes an
error as no tmpfs is currently mounted.
This patch makes sure all extra mounts are mounted right after the `/`
partition, allowing the use of a read-only rootfs.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This variable is declared in `if m:`. Of course if this codepath doesn't
run, the variable is not declared an Python doesn't like this kind of
surprise...
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
- If KPMcore is found -- it requires some other KDE Frameworks but
at least in pre-4.0 versions doesn't check very well for them --
then missing its dependencies is no cause for CMake failure.
Instead, log it nicely and suppress the module.
- stop compiler warnings with some judicious casting;
that's what you get when a container indexed by int
stored those indexes as quintptr.
- apply coding style
- do static initialization more carefully
- float -> qreal (double) because that's what the Qt API expects,
to reduce type-conversion warnings
- apply current coding style
- calamares_automoc() sets AUTOMOC, but also adds some flags
to avoid compilation warnings from the generated MOC code.
- drop weird hard-coded include paths
- Although milliseconds::count() is long long, we pass it to
a Qt interface that only takes int; let's assume we have
only a 32-bit count, since a timeout of 4 billion milliseconds
is roughly 46 days, which we'll just call "no timeout".
- Drop the round-trip of forming a JSON document from a QVariant,
then parsing the document into JSON objects and building a
model out of that. View the Variant directly.