logic: Fixed every project trying to load from cdb, added warning for trial mode on failed refresh

This commit is contained in:
Eberhard Graether
2017-02-13 12:40:45 +01:00
parent d5e2bbb17c
commit 2ade5ca976
3 changed files with 16 additions and 7 deletions
+1 -2
View File
@@ -21,7 +21,6 @@
#include "settings/ApplicationSettings.h"
#include "settings/ColorScheme.h"
// useless comment
void Application::createInstance(
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory
){
@@ -177,7 +176,7 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
void Application::refreshProject(bool force)
{
if (m_project && !m_isInTrial)
if (m_project)
{
bool indexing = m_project->refresh(force);
if (indexing)
+12
View File
@@ -15,6 +15,7 @@
#include "utility/file/FileRegister.h"
#include "utility/messaging/type/MessageClearErrorCount.h"
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
#include "utility/messaging/type/MessageFinishedParsing.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/messaging/type/MessageStatus.h"
@@ -99,6 +100,17 @@ bool Project::refresh(bool forceRefresh)
}
}
if (Application::getInstance()->isInTrial())
{
std::vector<std::string> options;
options.push_back("Ok");
m_dialogView->confirm("You can't refresh the project in trial mode, please unlock with a license key.", options);
MessageDispatchWhenLicenseValid(std::make_shared<MessageRefresh>()).dispatch();
return false;
}
if (!prepareRefresh())
{
return false;
+3 -5
View File
@@ -176,14 +176,12 @@ std::vector<FilePath> ProjectSettings::makePathsAbsolute(const std::vector<FileP
FilePath ProjectSettings::makePathAbsolute(const FilePath& path) const
{
FilePath basePath = getProjectFileLocation();
if (!path.isAbsolute())
if (path.empty() || path.isAbsolute())
{
return basePath.concat(path).canonical();
return path;
}
return path;
return getProjectFileLocation().concat(path).canonical();
}
std::vector<std::string> ProjectSettings::getDefaultSourceExtensions() const