File indexing completed on 2024-04-28 04:38:54

0001 /*
0002     SPDX-FileCopyrightText: 2017 Anton Anikin <anton.anikin@htower.ru>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "utils.h"
0008 
0009 #include <interfaces/icore.h>
0010 #include <interfaces/iuicontroller.h>
0011 #include <KParts/MainWindow>
0012 
0013 #include <QStandardPaths>
0014 
0015 namespace Heaptrack
0016 {
0017     QString findExecutable(const QString& fallbackExecutablePath)
0018     {
0019         QString executablePath = QStandardPaths::findExecutable(fallbackExecutablePath);
0020         return executablePath.isEmpty() ? fallbackExecutablePath : executablePath;
0021     }
0022 
0023     QWidget* activeMainWindow()
0024     {
0025         return KDevelop::ICore::self()->uiController()->activeMainWindow();
0026     }
0027 }