Commit Graph

26 Commits

Author SHA1 Message Date
Andrius Štikonas 85396708f4 Use Qt::SplitBehavior
Old version QString::SplitBehavious is now deprecated.
2020-10-13 01:23:29 +01:00
Adriaan de Groot 08c1acb6b4 Missing include (clang/FreeBSD triggers this) 2020-10-10 21:59:57 +02:00
Andrius Štikonas 11bb5799ec REUSE: SPDX license headers for backend and core folders. 2020-09-20 20:33:16 +01:00
Andrius Štikonas ba46ea64ba defaults option in fstab is not necessary, e.g. defaults,ro is the same as defaults. 2020-09-14 02:25:36 +01:00
Andrius Štikonas a928c62a7d Make fstab parsing slightly more readable. 2020-09-14 02:19:14 +01:00
Andrius Štikonas 1d195b00da Prettier formatting of fstab file. 2020-09-14 02:15:20 +01:00
Andrius Štikonas 2ed9953694 Simplify some External Command functions. 2020-09-11 20:27:24 +01:00
Andrius Štikonas 5b80c6045c Fix fstab editing functionality.
In the old code QByteArray fstabContents was actually empty.
Also, writeData function was opening file in append mode,
thus nothing was actually written.

Split writeData function into two:
  * one for block devices
  * another for writing fstab file

BUG: 417205
2020-09-10 23:54:23 +01:00
Adriaan de Groot 1d9b1161d4 On non-Linux, findBlkIdDevice() has unused parameters
Summary: Add Q_UNUSED() to mark the unused parameters

Test Plan: Builds with fewer warnings on FreeBSD

Differential Revision: https://phabricator.kde.org/D24155
2020-05-08 16:18:14 +02:00
Andrius Štikonas 9fa20fb1e2 Remove "mv" command from allowed external command list 2019-01-12 23:18:01 +00:00
Andrius Štikonas 622def3b56 Convert more enums to scoped enums. 2018-04-09 15:14:34 +01:00
Andrius Štikonas 398e9c3df5 d-pointerize FstabEntry class 2018-04-01 18:46:26 +01:00
Andrius Štikonas f2b7f2bd9b Use const char* instead of QString in Fstab::findBlkIdDevice
Thansk to: Adriaan de Groot
2018-01-31 17:02:59 +00:00
Andrius Štikonas f98dbcc208 Only use libblkid on Linux. 2018-01-31 16:58:00 +00:00
Andrius Štikonas 838150d439 Do not use blkid cache. 2018-01-31 16:53:34 +00:00
Andrius Štikonas 906a89c16d Use ExternalCommand to copy fstab file to its final location. 2017-12-10 17:36:39 +00:00
Andrius Štikonas d2f13ff4cc QFile->QTemporaryFile. 2017-12-10 17:36:39 +00:00
Andrius Štikonas 098fdee506 fstab fixes:
* Do not output # for empty inline comments.
  * More checks to validate fstab entry.
2017-09-20 21:22:53 +01:00
Andrius Štikonas a3732c1459 Fix a typo. Remove extra trimmed(). 2017-09-17 13:52:48 +01:00
Andrius Štikonas d99b3f6eb3 Improve QFileInfo usage.
Cache QFileInfo result in a local variable.
Before repeated request often incorrectly resulted in QString()
2017-09-17 00:39:53 +01:00
Andrius Štikonas 8dd1e70b21 Fix inline comment handling.
CCBUG: 305469
2017-09-16 20:50:57 +01:00
Andrius Štikonas baec157314 Add a function to write fstab file.
CCBUG: 305469
2017-09-16 20:40:46 +01:00
Andrius Štikonas 8719fb0bf3 Add fstab mutators. 2017-09-16 20:16:17 +01:00
Andrius Štikonas 4257021857 Use QStringList to store fstab options. 2017-09-16 19:09:03 +01:00
Andrius Štikonas 268a68a318 Split fstab lines with both spaces and tabs. 2017-09-13 23:05:32 +01:00
Andrius Štikonas 34712dd2ed Add fstab file parser.
Remove dependency on KMountPoint and hence KIO.
2017-09-13 18:46:33 +01:00