mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
Merge pull request #1436 from gportay/osprober-strip-extra-file-after-at-sign
[partition] Strip extra file after the at sign
This commit is contained in:
commit
1df4239c02
3 changed files with 12 additions and 3 deletions
|
@ -41,6 +41,7 @@ struct OsproberEntry
|
||||||
{
|
{
|
||||||
QString prettyName;
|
QString prettyName;
|
||||||
QString path;
|
QString path;
|
||||||
|
QString file;
|
||||||
QString uuid;
|
QString uuid;
|
||||||
bool canBeResized;
|
bool canBeResized;
|
||||||
QStringList line;
|
QStringList line;
|
||||||
|
|
|
@ -393,17 +393,25 @@ runOsprober( DeviceModel* dm )
|
||||||
prettyName = lineColumns.value( 2 ).simplified();
|
prettyName = lineColumns.value( 2 ).simplified();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString path = lineColumns.value( 0 ).simplified();
|
QString file, path = lineColumns.value( 0 ).simplified();
|
||||||
if ( !path.startsWith( "/dev/" ) ) //basic sanity check
|
if ( !path.startsWith( "/dev/" ) ) //basic sanity check
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// strip extra file after device: /dev/name@/path/to/file
|
||||||
|
int index = path.indexOf( '@' );
|
||||||
|
if ( index != -1 )
|
||||||
|
{
|
||||||
|
file = path.right( path.length() - index - 1 );
|
||||||
|
path = path.left( index );
|
||||||
|
}
|
||||||
|
|
||||||
FstabEntryList fstabEntries = lookForFstabEntries( path );
|
FstabEntryList fstabEntries = lookForFstabEntries( path );
|
||||||
QString homePath = findPartitionPathForMountPoint( fstabEntries, "/home" );
|
QString homePath = findPartitionPathForMountPoint( fstabEntries, "/home" );
|
||||||
|
|
||||||
osproberEntries.append(
|
osproberEntries.append(
|
||||||
{ prettyName, path, QString(), canBeResized( dm, path ), lineColumns, fstabEntries, homePath } );
|
{ prettyName, path, file, QString(), canBeResized( dm, path ), lineColumns, fstabEntries, homePath } );
|
||||||
osproberCleanLines.append( line );
|
osproberCleanLines.append( line );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ ReplaceWidget::onPartitionSelected()
|
||||||
|
|
||||||
QString fsNameForUser = userVisibleFS( partition->fileSystem() );
|
QString fsNameForUser = userVisibleFS( partition->fileSystem() );
|
||||||
QString prettyName = tr( "Data partition (%1)" ).arg( fsNameForUser );
|
QString prettyName = tr( "Data partition (%1)" ).arg( fsNameForUser );
|
||||||
for ( const QString& line : osproberLines )
|
for ( const auto& line : osproberLines )
|
||||||
{
|
{
|
||||||
QStringList lineColumns = line.split( ':' );
|
QStringList lineColumns = line.split( ':' );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue