Apply suggestions from code review
Co-authored-by: seth <getchoo@tuta.io> Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
0afdce8a31
commit
8d14060ad1
@ -43,7 +43,7 @@ QString findBinPath(QString root, QString pattern)
|
||||
|
||||
void SymlinkTask::executeTask()
|
||||
{
|
||||
setStatus(tr("Check Java bin"));
|
||||
setStatus(tr("Checking for Java binary path"));
|
||||
const auto binPath = FS::PathCombine("bin", "java");
|
||||
const auto wantedPath = FS::PathCombine(m_path, binPath);
|
||||
if (QFileInfo::exists(wantedPath)) {
|
||||
@ -51,16 +51,16 @@ void SymlinkTask::executeTask()
|
||||
return;
|
||||
}
|
||||
|
||||
setStatus(tr("Search for Java bin"));
|
||||
setStatus(tr("Searching for Java binary path"));
|
||||
const auto contentsPartialPath = FS::PathCombine("Contents", "Home", binPath);
|
||||
const auto relativePathToBin = findBinPath(m_path, contentsPartialPath);
|
||||
if (relativePathToBin.isEmpty()) {
|
||||
emitFailed(tr("Failed to find bin java"));
|
||||
emitFailed(tr("Failed to find Java binary path"));
|
||||
return;
|
||||
}
|
||||
const auto folderToLink = relativePathToBin.chopped(binPath.length());
|
||||
|
||||
setStatus(tr("Collect folders to symlink"));
|
||||
setStatus(tr("Collecting folders to symlink"));
|
||||
auto entries = QDir(folderToLink).entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||
QList<FS::LinkPair> files;
|
||||
setProgress(0, entries.length());
|
||||
@ -68,7 +68,7 @@ void SymlinkTask::executeTask()
|
||||
files.append({ entry.absoluteFilePath(), FS::PathCombine(m_path, entry.fileName()) });
|
||||
}
|
||||
|
||||
setStatus(tr("Symlink Java"));
|
||||
setStatus(tr("Symlinking Java binary path"));
|
||||
FS::create_link folderLink(files);
|
||||
connect(&folderLink, &FS::create_link::fileLinked, [this](QString src, QString dst) { setProgress(m_progress + 1, m_progressTotal); });
|
||||
if (!folderLink()) {
|
||||
|
Loading…
Reference in New Issue
Block a user