rename to GenericProfiler

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-08-15 22:18:28 +03:00
parent c28d9161cf
commit fa164aa081
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
4 changed files with 16 additions and 14 deletions

View File

@ -49,7 +49,7 @@
#include "pathmatcher/MultiMatcher.h"
#include "pathmatcher/SimplePrefixMatcher.h"
#include "settings/INIFile.h"
#include "tools/WaitProfiler.h"
#include "tools/GenericProfiler.h"
#include "ui/InstanceWindow.h"
#include "ui/MainWindow.h"
@ -817,7 +817,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
// FIXME: what to do with these?
m_profilers.insert("jprofiler", std::shared_ptr<BaseProfilerFactory>(new JProfilerFactory()));
m_profilers.insert("jvisualvm", std::shared_ptr<BaseProfilerFactory>(new JVisualVMFactory()));
m_profilers.insert("waitprofiler", std::shared_ptr<BaseProfilerFactory>(new WaitProfilerFactory()));
m_profilers.insert("generic", std::shared_ptr<BaseProfilerFactory>(new GenericProfilerFactory()));
for (auto profiler : m_profilers.values()) {
profiler->registerSettings(m_settings);
}

View File

@ -457,8 +457,8 @@ set(TOOLS_SOURCES
tools/JVisualVM.h
tools/MCEditTool.cpp
tools/MCEditTool.h
tools/WaitProfiler.cpp
tools/WaitProfiler.h
tools/GenericProfiler.cpp
tools/GenericProfiler.h
)
set(META_SOURCES

View File

@ -15,30 +15,32 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "WaitProfiler.h"
#include "GenericProfiler.h"
#include "BaseInstance.h"
#include "launch/LaunchTask.h"
#include "settings/SettingsObject.h"
class WaitProfiler : public BaseProfiler {
class GenericProfiler : public BaseProfiler {
Q_OBJECT
public:
WaitProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject* parent = 0);
GenericProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject* parent = 0);
protected:
void beginProfilingImpl(shared_qobject_ptr<LaunchTask> process);
};
WaitProfiler::WaitProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject* parent) : BaseProfiler(settings, instance, parent) {}
GenericProfiler::GenericProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject* parent)
: BaseProfiler(settings, instance, parent)
{}
void WaitProfiler::beginProfilingImpl(shared_qobject_ptr<LaunchTask> process)
void GenericProfiler::beginProfilingImpl(shared_qobject_ptr<LaunchTask> process)
{
emit readyToLaunch(tr("Started process: %1").arg(process->pid()));
}
BaseExternalTool* WaitProfilerFactory::createTool(InstancePtr instance, QObject* parent)
BaseExternalTool* GenericProfilerFactory::createTool(InstancePtr instance, QObject* parent)
{
return new WaitProfiler(globalSettings, instance, parent);
return new GenericProfiler(globalSettings, instance, parent);
}
#include "WaitProfiler.moc"
#include "GenericProfiler.moc"

View File

@ -19,9 +19,9 @@
#include "BaseProfiler.h"
class WaitProfilerFactory : public BaseProfilerFactory {
class GenericProfilerFactory : public BaseProfilerFactory {
public:
QString name() const override { return "WaitProfiler"; }
QString name() const override { return "Generic"; }
void registerSettings([[maybe_unused]] SettingsObjectPtr settings) override{};
BaseExternalTool* createTool(InstancePtr instance, QObject* parent = 0) override;
bool check([[maybe_unused]] QString* error) override { return true; };