logic: Fixed every project trying to load from cdb, added warning for trial mode on failed refresh
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user