Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[systemsettings] Ability to rename SD card and partitions. JB#54905 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amakarik
Copy link

@amakarik amakarik commented Jul 8, 2021

No description provided.

@pvuorela
Copy link
Contributor

pvuorela commented Jul 9, 2021

@Tomin1 could you check

@pvuorela pvuorela requested a review from Tomin1 August 12, 2021 11:56
@rainemak rainemak self-requested a review August 13, 2021 06:13
src/udisks2monitor.cpp Outdated Show resolved Hide resolved
@rainemak
Copy link
Member

Ping @Tomin1

Copy link
Member

@Tomin1 Tomin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments. I didn't try this yet.

src/partitionmodel.cpp Outdated Show resolved Hide resolved
src/partitionmanager.cpp Outdated Show resolved Hide resolved
src/udisks2monitor.cpp Outdated Show resolved Hide resolved
Copy link
Member

@Tomin1 Tomin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some error handling things and I started wondering about one UI design related thing, see the comments below.

src/udisks2monitor.cpp Outdated Show resolved Hide resolved
src/udisks2monitor.cpp Outdated Show resolved Hide resolved
@amakarik
Copy link
Author

Now this has error handling in the sense that it does log error but it doesn't give UI any chance of showing that something > went wrong. It just stops. That doesn't seem good to me, the very least it should emit error signal. However if you didn't do > unmount / mount in setLabel, then you would not need to handle that many errors."

-fixed

src/partition.h Outdated
@@ -73,7 +73,8 @@ class SYSTEMSETTINGS_EXPORT Partition
Unlocking,
Unlocked,
Locking,
Locked
Locked,
Renamed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? The mounted/unmounted type of statuses make sense and so do transient mounting/unmounting etc, but this sort of of "end states" feel funny. The "Formatted" is an existing thing, but are they really different from "Unmounted" other than that the partition tracking has seen or initiated some related operation?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Removed Renamed status

@pvuorela
Copy link
Contributor

pvuorela commented Nov 2, 2021

Generally looks fine for me now.

One thing missing from the API, though, is any kind of indication there is this task ongoing or when it succeeds. The Renamed status did the latter part but for the mentioned reasons it wasn't good either. a transient "Renaming" type of status could be ok. But how much that matters depends on the UI. Perhaps could be done separately too.

@amakarik
Copy link
Author

amakarik commented Nov 2, 2021

Generally looks fine for me now.

One thing missing from the API, though, is any kind of indication there is this task ongoing or when it succeeds. The Renamed status did the latter part but for the mentioned reasons it wasn't good either. a transient "Renaming" type of status could be ok. But how much that matters depends on the UI. Perhaps could be done separately too.

Generally looks fine for me now.

One thing missing from the API, though, is any kind of indication there is this task ongoing or when it succeeds. The Renamed status did the latter part but for the mentioned reasons it wasn't good either. a transient "Renaming" type of status could be ok. But how much that matters depends on the UI. Perhaps could be done separately too.

Done. Add "Renaming" status

watcher->deleteLater();
});

emit status(devicePath, Partition::Renaming);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now the only new status change on the last update. Per se good, but what's now removing the Renaming state when the operation is done?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see. What status should be set when operation is done? "Renamed"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect Unmounted if the operation can be done only to unmounted partitions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

connect(watcher, &QDBusPendingCallWatcher::finished,
this, [this, devicePath, dbusMethod](QDBusPendingCallWatcher *watcher) {
if (watcher->isValid() && watcher->isFinished()) {
emit status(devicePath, Partition::Unmounted);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On error this stays forever on Renaming?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For small polish could move the status changes after the 'if', on both branches it's the last thing done.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@pvuorela
Copy link
Contributor

pvuorela commented Nov 3, 2021

One minor comment but besides that looks at least good to me. Could still test once the UI gets some polish.

@pvuorela
Copy link
Contributor

Tried running this with the current UI side PR and renaming a vfat partition. Didn't succeed.

For the errors the journal didn't include much, just:
[W] unknown:0 - "SetLabel" error: org.freedesktop.UDisks2.Error.Failed

The UI didn't complain about anything.

With dbus-monitor on the system bus noticed:
string "Error setting label: Error spawning command-line `dosfslabel "/dev/mmcblk1p1" "SD-KORTTIHJ"': Failed to execute child process “dosfslabel” (No such file or directory) (g-exec-error-quark, 8)"

Would be included in dosfstools, but that's gplv3 and compiled into tools side only https://github.com/mer-tools/dosfstools

Instead we have busybox-symlinks-dosfstools which doesn't seem to include such a thing.

@amakarik
Copy link
Author

Tried running this with the current UI side PR and renaming a vfat partition. Didn't succeed.

For the errors the journal didn't include much, just: [W] unknown:0 - "SetLabel" error: org.freedesktop.UDisks2.Error.Failed

The UI didn't complain about anything.

With dbus-monitor on the system bus noticed: string "Error setting label: Error spawning command-line `dosfslabel "/dev/mmcblk1p1" "SD-KORTTIHJ"': Failed to execute child process “dosfslabel” (No such file or directory) (g-exec-error-quark, 8)"

Would be included in dosfstools, but that's gplv3 and compiled into tools side only https://github.com/mer-tools/dosfstools

Instead we have busybox-symlinks-dosfstools which doesn't seem to include such a thing.

It requires dosfstools to be installed. It doesn't work with busybox-symlinks-dosfstools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants