Remove direct include of Code/CaptureContext.h in almost all files

* This is a leftover from before the interface was hoisted out, and most
  windows were still calling directly to CaptureContext instead of via
  the public ICaptureContext interface
This commit is contained in:
baldurk
2017-11-22 19:11:20 +00:00
parent 203f6b5255
commit e75a468d3c
39 changed files with 26 additions and 64 deletions
-3
View File
@@ -52,8 +52,6 @@ class TimelineBar;
class PythonShell;
class ResourceInspector;
QString ConfigFilePath(const QString &filename);
class CaptureContext : public ICaptureContext
{
Q_DECLARE_TR_FUNCTIONS(CaptureContext);
@@ -65,7 +63,6 @@ public:
bool isRunning();
QString ConfigFilePath(const QString &filename) override { return ::ConfigFilePath(filename); }
QString TempCaptureFilename(QString appname) override;
//////////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -121,7 +121,7 @@ CaptureSettings::CaptureSettings(const QVariant &v)
Options.DebugOutputMute = opts[lit("DebugOutputMute")].toBool();
}
QString ConfigFilePath(const QString &filename)
QString configFilePath(const QString &filename)
{
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
+14 -10
View File
@@ -946,15 +946,6 @@ struct EventBookmark
DOCUMENT("The capture context that the python script is running in.")
struct ICaptureContext
{
DOCUMENT(R"(Retrieve the absolute path where a given file can be stored with other application
data.
:param str filename: The base filename.
:return: The absolute path.
:rtype: ``str``
)");
virtual QString ConfigFilePath(const QString &filename) = 0;
DOCUMENT(R"(Retrieve the absolute path where a given temporary capture should be stored.
data.
@@ -1794,4 +1785,17 @@ This may return ``None`` if no capture context can be found.
:return: The capture context associated with this widget, if one unambiguously exists.
:rtype: CaptureContext
)");
ICaptureContext *getCaptureContext(const QWidget *widget);
ICaptureContext *getCaptureContext(const QWidget *widget);
DOCUMENT(R"(Retrieve the absolute path where a given file can be stored with other application
data.
:param str filename: The base filename.
:return: The absolute path.
:rtype: ``str``
)");
QString configFilePath(const QString &filename);
// simple helper for the common case of 'we just need to run this on the replay thread'
#define INVOKE_MEMFN(function) \
m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) { function(r); });
-4
View File
@@ -39,10 +39,6 @@ struct IReplayController;
class LambdaThread;
class RemoteHost;
// simple helper for the common case of 'we just need to run this on the render thread
#define INVOKE_MEMFN(function) \
m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) { function(r); });
class ReplayManager : public IReplayManager
{
Q_DECLARE_TR_FUNCTIONS(ReplayManager);
-1
View File
@@ -24,6 +24,5 @@
#pragma once
#include "Code/CaptureContext.h"
#include "Code/Interface/QRDInterface.h"
#include "Code/QRDUtils.h"
+1 -1
View File
@@ -192,7 +192,7 @@ int main(int argc, char *argv[])
dir.mkpath(configPath);
}
QString configFilename = ConfigFilePath(lit("UI.config"));
QString configFilename = configFilePath(lit("UI.config"));
if(!config.Load(configFilename))
{
-1
View File
@@ -25,7 +25,6 @@
#include "CustomPaintWidget.h"
#include <math.h>
#include <QPainter>
#include "Code/CaptureContext.h"
CustomPaintWidget::CustomPaintWidget(QWidget *parent) : QWidget(parent)
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
+1
View File
@@ -28,6 +28,7 @@
#include <QFontDatabase>
#include <QMenu>
#include <QMouseEvent>
#include <QMutexLocker>
#include <QScrollBar>
#include <QTimer>
#include <QtMath>
+1 -1
View File
@@ -25,7 +25,7 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
#include <QMutex>
namespace Ui
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -26,7 +26,6 @@
#include <QFrame>
#include <functional>
#include "Code/CaptureContext.h"
namespace Ui
{
-1
View File
@@ -28,7 +28,6 @@
#include <QMutex>
#include <QSemaphore>
#include <QTimer>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#include "PerformanceCounterSelection.h"
#include <QMenu>
#include <QSet>
#include "Code/CaptureContext.h"
#include "Code/Interface/QRDInterface.h"
#include "Code/Resources.h"
#include "ui_PerformanceCounterSelection.h"
@@ -23,7 +23,6 @@
******************************************************************************/
#include "SettingsDialog.h"
#include "Code/CaptureContext.h"
#include "Code/Interface/QRDInterface.h"
#include "Code/QRDUtils.h"
#include "Styles/StyleData.h"
@@ -25,7 +25,6 @@
#include "TextureSaveDialog.h"
#include <QColorDialog>
#include <QFileInfo>
#include "Code/CaptureContext.h"
#include "Code/QRDUtils.h"
#include "ui_TextureSaveDialog.h"
-2
View File
@@ -28,8 +28,6 @@
#include <QString>
#include <QVector>
#include "Code/CaptureContext.h"
namespace Ui
{
class TipsDialog;
@@ -29,7 +29,6 @@
#include <QPushButton>
#include <QRegExp>
#include <QSortFilterProxyModel>
#include "Code/CaptureContext.h"
#include "Code/ReplayManager.h"
#include "Code/Resources.h"
#include "ui_VirtualFileDialog.h"
-1
View File
@@ -29,7 +29,6 @@
#include <QShortcut>
#include <QTimer>
#include "3rdparty/flowlayout/FlowLayout.h"
#include "Code/CaptureContext.h"
#include "Code/QRDUtils.h"
#include "Code/Resources.h"
#include "Widgets/Extended/RDHeaderView.h"
-1
View File
@@ -26,7 +26,6 @@
#include <QFrame>
#include <QIcon>
#include "Code/CaptureContext.h"
namespace Ui
{
+1 -2
View File
@@ -33,7 +33,6 @@
#include <QProgressDialog>
#include <QToolButton>
#include <QToolTip>
#include "Code/CaptureContext.h"
#include "Code/QRDUtils.h"
#include "Code/Resources.h"
#include "Resources/resource.h"
@@ -263,7 +262,7 @@ QString MainWindow::GetLayoutPath(int layout)
if(layout > 0)
filename = lit("Layout%1.config").arg(layout);
return ConfigFilePath(filename);
return configFilePath(filename);
}
void MainWindow::on_action_Exit_triggered()
-1
View File
@@ -28,7 +28,6 @@
#include <QMainWindow>
#include <QTimer>
#include "3rdparty/toolwindowmanager/ToolWindowManager.h"
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
-4
View File
@@ -46,10 +46,6 @@ struct CaptureContextInvoker : ICaptureContext
// pass-through functions that don't need the UI thread
///////////////////////////////////////////////////////////////////////
//
virtual QString ConfigFilePath(const QString &filename) override
{
return m_Ctx.ConfigFilePath(filename);
}
virtual QString TempCaptureFilename(QString appname) override
{
return m_Ctx.TempCaptureFilename(appname);
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
class PythonContext;
class ScintillaEdit;
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
+7 -8
View File
@@ -37,7 +37,6 @@
#include <QStyledItemDelegate>
#include "3rdparty/flowlayout/FlowLayout.h"
#include "3rdparty/toolwindowmanager/ToolWindowManagerArea.h"
#include "Code/CaptureContext.h"
#include "Code/QRDUtils.h"
#include "Code/Resources.h"
#include "Dialogs/TextureSaveDialog.h"
@@ -2460,7 +2459,7 @@ void TextureViewer::OnCaptureLoaded()
GUIInvoke::call([this]() { OnEventChanged(m_Ctx.CurEvent()); });
});
m_Watcher = new QFileSystemWatcher({ConfigFilePath(QString())}, this);
m_Watcher = new QFileSystemWatcher({configFilePath(QString())}, this);
QObject::connect(m_Watcher, &QFileSystemWatcher::fileChanged, this,
&TextureViewer::customShaderModified);
@@ -3559,7 +3558,7 @@ void TextureViewer::reloadCustomShaders(const QString &filter)
}
QStringList files =
QDir(ConfigFilePath(QString()))
QDir(configFilePath(QString()))
.entryList({QFormatStr("*.%1").arg(m_Ctx.CurPipelineState().GetShaderExtension())},
QDir::Files | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase);
@@ -3572,11 +3571,11 @@ void TextureViewer::reloadCustomShaders(const QString &filter)
QString fn = QFileInfo(f).baseName();
QString key = fn.toUpper();
m_Watcher->addPath(ConfigFilePath(f));
m_Watcher->addPath(configFilePath(f));
if(!m_CustomShaders.contains(key) && !m_CustomShadersBusy.contains(key))
{
QFile fileHandle(ConfigFilePath(f));
QFile fileHandle(configFilePath(f));
if(fileHandle.open(QFile::ReadOnly | QFile::Text))
{
QTextStream stream(&fileHandle);
@@ -3635,7 +3634,7 @@ void TextureViewer::on_customCreate_clicked()
return;
}
QString path = ConfigFilePath(filename + lit(".") + m_Ctx.CurPipelineState().GetShaderExtension());
QString path = configFilePath(filename + lit(".") + m_Ctx.CurPipelineState().GetShaderExtension());
QString src;
@@ -3690,7 +3689,7 @@ void TextureViewer::on_customEdit_clicked()
return;
}
QString path = ConfigFilePath(filename + lit(".") + m_Ctx.CurPipelineState().GetShaderExtension());
QString path = configFilePath(filename + lit(".") + m_Ctx.CurPipelineState().GetShaderExtension());
QString src;
@@ -3769,7 +3768,7 @@ void TextureViewer::on_customDelete_clicked()
if(res == QMessageBox::Yes)
{
QString path =
ConfigFilePath(shaderName + lit(".") + m_Ctx.CurPipelineState().GetShaderExtension());
configFilePath(shaderName + lit(".") + m_Ctx.CurPipelineState().GetShaderExtension());
if(!QFileInfo::exists(path))
{
RDDialog::critical(
-1
View File
@@ -27,7 +27,6 @@
#include <QFrame>
#include <QMenu>
#include <QMouseEvent>
#include "Code/CaptureContext.h"
namespace Ui
{
-1
View File
@@ -25,7 +25,6 @@
#pragma once
#include <QAbstractScrollArea>
#include "Code/CaptureContext.h"
class TimelineBar : public QAbstractScrollArea, public ITimelineBar, public ICaptureViewer
{