cleanup: code review sugestions
clean up translation strings Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
dc5402349e
commit
458c2f38bc
@ -66,7 +66,7 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
|
|||||||
m_settings->registerSetting("totalTimePlayed", 0);
|
m_settings->registerSetting("totalTimePlayed", 0);
|
||||||
m_settings->registerSetting("lastTimePlayed", 0);
|
m_settings->registerSetting("lastTimePlayed", 0);
|
||||||
|
|
||||||
m_settings->registerSetting("linkedInstancesList", "[]");
|
m_settings->registerSetting("linkedInstances", "[]");
|
||||||
|
|
||||||
// Game time override
|
// Game time override
|
||||||
auto gameTimeOverride = m_settings->registerSetting("OverrideGameTime", false);
|
auto gameTimeOverride = m_settings->registerSetting("OverrideGameTime", false);
|
||||||
@ -188,34 +188,34 @@ bool BaseInstance::shouldStopOnConsoleOverflow() const
|
|||||||
|
|
||||||
QStringList BaseInstance::getLinkedInstances() const
|
QStringList BaseInstance::getLinkedInstances() const
|
||||||
{
|
{
|
||||||
return m_settings->getList<QString>("linkedInstancesList");
|
return m_settings->getList<QString>("linkedInstances");
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseInstance::setLinkedInstances(const QStringList& list)
|
void BaseInstance::setLinkedInstances(const QStringList& list)
|
||||||
{
|
{
|
||||||
auto linkedInstancesList = m_settings->getList<QString>("linkedInstancesList");
|
auto linkedInstances = m_settings->getList<QString>("linkedInstances");
|
||||||
m_settings->setList("linkedInstancesList", list);
|
m_settings->setList("linkedInstances", list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseInstance::addLinkedInstanceId(const QString& id)
|
void BaseInstance::addLinkedInstanceId(const QString& id)
|
||||||
{
|
{
|
||||||
auto linkedInstancesList = m_settings->getList<QString>("linkedInstancesList");
|
auto linkedInstances = m_settings->getList<QString>("linkedInstances");
|
||||||
linkedInstancesList.append(id);
|
linkedInstances.append(id);
|
||||||
setLinkedInstances(linkedInstancesList);
|
setLinkedInstances(linkedInstances);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseInstance::removeLinkedInstanceId(const QString& id)
|
bool BaseInstance::removeLinkedInstanceId(const QString& id)
|
||||||
{
|
{
|
||||||
auto linkedInstancesList = m_settings->getList<QString>("linkedInstancesList");
|
auto linkedInstances = m_settings->getList<QString>("linkedInstances");
|
||||||
int numRemoved = linkedInstancesList.removeAll(id);
|
int numRemoved = linkedInstances.removeAll(id);
|
||||||
setLinkedInstances(linkedInstancesList);
|
setLinkedInstances(linkedInstances);
|
||||||
return numRemoved > 0;
|
return numRemoved > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseInstance::isLinkedToInstanceId(const QString& id) const
|
bool BaseInstance::isLinkedToInstanceId(const QString& id) const
|
||||||
{
|
{
|
||||||
auto linkedInstancesList = m_settings->getList<QString>("linkedInstancesList");
|
auto linkedInstances = m_settings->getList<QString>("linkedInstances");
|
||||||
return linkedInstancesList.contains(id);
|
return linkedInstances.contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseInstance::iconUpdated(QString key)
|
void BaseInstance::iconUpdated(QString key)
|
||||||
|
@ -10,10 +10,6 @@ InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, const InstanceCopyP
|
|||||||
{
|
{
|
||||||
m_origInstance = origInstance;
|
m_origInstance = origInstance;
|
||||||
m_keepPlaytime = prefs.isKeepPlaytimeEnabled();
|
m_keepPlaytime = prefs.isKeepPlaytimeEnabled();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_useLinks = prefs.isUseSymLinksEnabled();
|
m_useLinks = prefs.isUseSymLinksEnabled();
|
||||||
m_linkRecursively = prefs.isLinkRecursivelyEnabled();
|
m_linkRecursively = prefs.isLinkRecursivelyEnabled();
|
||||||
m_useHardLinks = prefs.isLinkRecursivelyEnabled() && prefs.isUseHardLinksEnabled();
|
m_useHardLinks = prefs.isLinkRecursivelyEnabled() && prefs.isUseHardLinksEnabled();
|
||||||
|
@ -25,4 +25,4 @@
|
|||||||
</requestedPrivileges>
|
</requestedPrivileges>
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
@ -28,4 +28,4 @@ int main(int argc, char *argv[])
|
|||||||
FileLinkApp ldh(argc, argv);
|
FileLinkApp ldh(argc, argv);
|
||||||
|
|
||||||
return ldh.exec();
|
return ldh.exec();
|
||||||
}
|
}
|
||||||
|
@ -237,11 +237,11 @@ QVariant WorldList::data(const QModelIndex &index, int role) const
|
|||||||
{
|
{
|
||||||
if (column == InfoColumn) {
|
if (column == InfoColumn) {
|
||||||
if (world.isSymLinkUnder(instDirPath())) {
|
if (world.isSymLinkUnder(instDirPath())) {
|
||||||
return tr("Warning: This world is symbolically linked from elsewhere. Editing it will also change the original") +
|
return tr("Warning: This world is symbolically linked from elsewhere. Editing it will also change the original."
|
||||||
tr("\nCanonical Path: %1").arg(world.canonicalFilePath());
|
"\nCanonical Path: %1").arg(world.canonicalFilePath());
|
||||||
}
|
}
|
||||||
if (world.isMoreThanOneHardLink()) {
|
if (world.isMoreThanOneHardLink()) {
|
||||||
return tr("Warning: This world is hard linked elsewhere. Editing it will also change the original");
|
return tr("Warning: This world is hard linked elsewhere. Editing it will also change the original.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return world.folderName();
|
return world.folderName();
|
||||||
|
@ -104,12 +104,13 @@ QVariant ModFolderModel::data(const QModelIndex &index, int role) const
|
|||||||
if (column == NAME_COLUMN) {
|
if (column == NAME_COLUMN) {
|
||||||
if (at(row)->isSymLinkUnder(instDirPath())) {
|
if (at(row)->isSymLinkUnder(instDirPath())) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original") +
|
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
|
||||||
tr("\nCanonical Path: %1").arg(at(row)->fileinfo().canonicalFilePath());
|
"\nCanonical Path: %1")
|
||||||
|
.arg(at(row)->fileinfo().canonicalFilePath());
|
||||||
}
|
}
|
||||||
if (at(row)->isMoreThanOneHardLink()) {
|
if (at(row)->isMoreThanOneHardLink()) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original");
|
tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m_resources[row]->internal_id();
|
return m_resources[row]->internal_id();
|
||||||
|
@ -424,12 +424,13 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
|
|||||||
if (column == NAME_COLUMN) {
|
if (column == NAME_COLUMN) {
|
||||||
if (at(row).isSymLinkUnder(instDirPath())) {
|
if (at(row).isSymLinkUnder(instDirPath())) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original") +
|
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
|
||||||
tr("\nCanonical Path: %1").arg(at(row).fileinfo().canonicalFilePath());;
|
"\nCanonical Path: %1")
|
||||||
|
.arg(at(row).fileinfo().canonicalFilePath());;
|
||||||
}
|
}
|
||||||
if (at(row).isMoreThanOneHardLink()) {
|
if (at(row).isMoreThanOneHardLink()) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original");
|
tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,12 +96,13 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
|
|||||||
if (column == NAME_COLUMN) {
|
if (column == NAME_COLUMN) {
|
||||||
if (at(row)->isSymLinkUnder(instDirPath())) {
|
if (at(row)->isSymLinkUnder(instDirPath())) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original") +
|
tr("\nWarning: This resource is symbolically linked from elsewhere. Editing it will also change the original."
|
||||||
tr("\nCanonical Path: %1").arg(at(row)->fileinfo().canonicalFilePath());;
|
"\nCanonical Path: %1")
|
||||||
|
.arg(at(row)->fileinfo().canonicalFilePath());;
|
||||||
}
|
}
|
||||||
if (at(row)->isMoreThanOneHardLink()) {
|
if (at(row)->isMoreThanOneHardLink()) {
|
||||||
return m_resources[row]->internal_id() +
|
return m_resources[row]->internal_id() +
|
||||||
tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original");
|
tr("\nWarning: This resource is hard linked elsewhere. Editing it will also change the original.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m_resources[row]->internal_id();
|
return m_resources[row]->internal_id();
|
||||||
|
@ -324,4 +324,4 @@ void CopyInstanceDialog::on_useCloneCheckbox_stateChanged(int state)
|
|||||||
m_selectedOptions.enableUseClone(m_cloneSupported && (state == Qt::Checked));
|
m_selectedOptions.enableUseClone(m_cloneSupported && (state == Qt::Checked));
|
||||||
updateUseCloneCheckbox();
|
updateUseCloneCheckbox();
|
||||||
updateLinkOptions();
|
updateLinkOptions();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user