forked from qt-creator/qt-creator
ProjectExplorer: Simplify some TaskHandler::canHandle() implementations
Change-Id: I957b40b8e920818a7dadf1d3edc01dc5ab8d2077 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -196,10 +196,7 @@ private:
|
|||||||
|
|
||||||
bool canHandle(const Task &task) const override
|
bool canHandle(const Task &task) const override
|
||||||
{
|
{
|
||||||
if (task.file.isEmpty())
|
return task.file.isReadableFile();
|
||||||
return false;
|
|
||||||
QFileInfo fi(task.file.toFileInfo());
|
|
||||||
return fi.exists() && fi.isFile() && fi.isReadable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle(const Task &task) override
|
void handle(const Task &task) override
|
||||||
@@ -227,8 +224,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool canHandle(const Task &task) const override
|
bool canHandle(const Task &task) const override
|
||||||
{
|
{
|
||||||
QFileInfo fi(task.file.toFileInfo());
|
if (!task.file.isReadableFile())
|
||||||
if (!fi.exists() || !fi.isFile() || !fi.isReadable())
|
|
||||||
return false;
|
return false;
|
||||||
IVersionControl *vc = VcsManager::findVersionControlForDirectory(task.file.absolutePath());
|
IVersionControl *vc = VcsManager::findVersionControlForDirectory(task.file.absolutePath());
|
||||||
if (!vc)
|
if (!vc)
|
||||||
|
Reference in New Issue
Block a user