forked from qt-creator/qt-creator
Make skipOpeningBigTextFile() public and use it in Diff Editor
Change-Id: I5e98d1ab93ac442c1f1a132a51ab838567a735a0 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -2793,6 +2793,11 @@ IEditor *EditorManager::openEditorWithContents(Id editorId,
|
||||
return edt;
|
||||
}
|
||||
|
||||
bool EditorManager::skipOpeningBigTextFile(const QString &filePath)
|
||||
{
|
||||
return EditorManagerPrivate::skipOpeningBigTextFile(filePath);
|
||||
}
|
||||
|
||||
bool EditorManager::saveDocument(IDocument *document)
|
||||
{
|
||||
return EditorManagerPrivate::saveDocument(document);
|
||||
|
||||
@@ -118,6 +118,7 @@ public:
|
||||
const QByteArray &contents = QByteArray(),
|
||||
const QString &uniqueId = QString(),
|
||||
OpenEditorFlags flags = NoFlags);
|
||||
static bool skipOpeningBigTextFile(const QString &filePath);
|
||||
|
||||
static bool openExternalEditor(const QString &fileName, Id editorId);
|
||||
static void addCloseEditorListener(const std::function<bool(IEditor *)> &listener);
|
||||
|
||||
@@ -481,13 +481,16 @@ void DiffEditorPlugin::diffExternalFiles()
|
||||
QString());
|
||||
if (fileName1.isNull())
|
||||
return;
|
||||
if (EditorManager::skipOpeningBigTextFile(fileName1))
|
||||
return;
|
||||
|
||||
const QString fileName2 = QFileDialog::getOpenFileName(ICore::dialogParent(),
|
||||
tr("Select Second File for Diff"),
|
||||
QString());
|
||||
if (fileName2.isNull())
|
||||
return;
|
||||
|
||||
if (EditorManager::skipOpeningBigTextFile(fileName2))
|
||||
return;
|
||||
|
||||
const QString documentId = QLatin1String("Diff ") + fileName1 + QLatin1String(", ") + fileName2;
|
||||
const QString title = tr("Diff \"%1\", \"%2\"").arg(fileName1, fileName2);
|
||||
|
||||
Reference in New Issue
Block a user