Skip to content

Commit a57672d

Browse files
committed
Address some review comments
1 parent f5c4598 commit a57672d

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

include/multipass/vm_image_vault_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ImageVaultUtils : public Singleton<ImageVaultUtils>
5252
QString extract_file(const QString& file,
5353
const ProgressMonitor& monitor,
5454
bool delete_original = false,
55-
const DecoderT& = DefaultDecoderT{}) const;
55+
const DecoderT& = DecoderT{}) const;
5656

5757
using HostMap = std::unordered_map<std::string, VMImageHost*>;
5858
using Hosts = std::vector<VMImageHost*>;

src/daemon/default_vm_image_vault.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ mp::VMImage mp::DefaultVMImageVault::fetch_image(const FetchType& fetch_type,
360360
0,
361361
checksum.has_value()};
362362

363-
QFileInfo file_info{image_url.path()};
364-
const auto image_filename = file_info.fileName();
363+
const auto image_filename = QFileInfo{image_url.path()}.fileName();
365364
// Attempt to make a sane directory name based on the filename of the image
366365

367366
const auto image_dir_name =

src/platform/backends/lxd/lxd_vm_image_vault.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ mp::VMImage mp::LXDVMImageVault::fetch_image(const FetchType& fetch_type,
307307
if (query.query_type != Query::Type::LocalFile)
308308
{
309309
// TODO: Need to make this async like in DefaultVMImageVault
310-
QFileInfo file_info{info.image_location};
311-
image_path = lxd_import_dir.filePath(file_info.fileName());
310+
image_path = lxd_import_dir.filePath(QFileInfo{info.image_location}.fileName());
312311

313312
url_download_image(info, image_path, monitor);
314313
}

tests/test_image_vault_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace
3535

3636
struct TestImageVaultUtils : public ::testing::Test
3737
{
38-
const mpt::MockFileOps::GuardedMock mock_file_ops_guard{StrictMock<mpt::MockFileOps>::inject()};
38+
const mpt::MockFileOps::GuardedMock mock_file_ops_guard{mpt::MockFileOps::inject<NiceMock>()};
3939
mpt::MockFileOps& mock_file_ops{*mock_file_ops_guard.first};
4040

4141
const QDir test_dir{"secrets/secret_filled_folder"};

0 commit comments

Comments
 (0)