Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MythContext refactoring (remove gContext) #671

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e48cf31
MythBackend.php: fix comment
ulmus-scott Nov 20, 2022
e935516
libs: remove unnecessary includes of "libmyth/mythcontext.h"
ulmus-scott Nov 20, 2022
6f75dfc
programs: remove unnecessary includes of "libmyth/mythcontext.h"
ulmus-scott Nov 20, 2022
3412be4
plugins: remove unnecessary includes of "libmyth/mythcontext.h"
ulmus-scott Nov 20, 2022
da6894a
MythContextSlotHandler: merge into MythContextPrivate
ulmus-scott Nov 19, 2022
b82819a
MythContextPrivate: PIMPL idiom style
ulmus-scott Nov 20, 2022
a4a5e9b
MythContext::Impl: remove member m_parent
ulmus-scott Nov 20, 2022
b5c665f
MythContext::Impl: create LanguagePrompt()
ulmus-scott Nov 20, 2022
d479f00
MythContext: C++ does not require a void parameter
ulmus-scott Nov 20, 2022
178fed2
MythContext::Impl::ResetDatabase(): convert to a static function
ulmus-scott Nov 22, 2022
6ccdc94
MythContext::Impl::LoadDatabaseSettings(): split into three function …
ulmus-scott Nov 22, 2022
2e2aeca
MythContext::Impl::SaveDatabaseParams(): directly access the MythDB s…
ulmus-scott Nov 22, 2022
1437dd4
libmyth/mythcontext.h: remove unnecessary includes
ulmus-scott Nov 17, 2024
565407c
create libmythbase/mythappname.h for MYTH_APPNAME_*
ulmus-scott Nov 17, 2024
c4e76e3
libmythmetadata/imagemetadata: remove Qt 5.4.1 specific code
ulmus-scott Nov 17, 2024
7ad2a29
remove unnecessary includes of "libmythbase/mythcorecontext.h"
ulmus-scott Nov 18, 2024
d5b849e
libmythbase/mythcorecontext.h: remove unnecessary include of "mythlog…
ulmus-scott Nov 18, 2024
0e8fd89
DatabaseParams: remove unused parameter m_forceSave
ulmus-scott Nov 18, 2024
f11dc54
remove DatabaseParams::LoadDefaults()
ulmus-scott Nov 18, 2024
53ed4f5
libmyth/mythcontext.cpp: create class DatabaseParamsCache
ulmus-scott Nov 18, 2024
212ef74
MythContext::Impl::SilenceDBerrors(): fix braces
ulmus-scott Nov 18, 2024
4b935a1
move constants to XmlConfiguration
ulmus-scott Nov 18, 2024
c0888c1
move constant to SSDP
ulmus-scott Nov 18, 2024
f71a7b5
merge DatabaseParamsCache into MythDB
ulmus-scott Nov 18, 2024
3e11bd3
mythfrontend/exitprompt.cpp: remove backend connection popup hack
ulmus-scott Nov 20, 2024
70d3faa
libmyth/mythcontext: remove gContext
ulmus-scott Nov 22, 2024
37482c1
SignalHandler: move calls into MythContext
ulmus-scott Nov 22, 2024
0b0e75b
merge CleanupGuard into MythContext
ulmus-scott Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/archivedbcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#include <QSqlError>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdbcheck.h>
#include <libmythbase/mythlogging.h>

// mytharchive
#include "archivedbcheck.h"
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mytharchive/mytharchive/archivesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <unistd.h>

// myth
#include <libmyth/mythcontext.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythdate.h>

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/archiveutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <QDomDocument>

// myth
#include <libmyth/mythcontext.h>
#include <libmythbase/exitcodes.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/editmetadata.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// myth
#include <libmyth/mythcontext.h>
#include <libmythbase/mythlogging.h>
#include <libmythui/mythuibutton.h>
#include <libmythui/mythuitext.h>
#include <libmythui/mythuitextedit.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/exportnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#include <QDomDocument>

// myth
#include <libmyth/mythcontext.h>
#include <libmythbase/exitcodes.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythbase/programinfo.h>
#include <libmythbase/remoteutil.h>
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/fileselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <QVariant>

// Myth
#include <libmyth/mythcontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/stringutil.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/importnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#include <QDomDocument>

// Myth
#include <libmyth/mythcontext.h>
#include <libmythbase/exitcodes.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
Expand Down
10 changes: 10 additions & 0 deletions mythplugins/mytharchive/mytharchive/logviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <QTextStream>

// mythtv
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythlogging.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythuibutton.h>
Expand Down Expand Up @@ -78,6 +80,14 @@ void showLogViewer(void)
}
}

LogViewer::LogViewer(MythScreenStack *parent)
: MythScreenType(parent, "logviewer"),
m_autoUpdate(gCoreContext->GetBoolSetting("LogViewerAutoUpdate", true)),
m_updateTime(gCoreContext->GetDurSetting<std::chrono::seconds>(
"LogViewerUpdateTime", DEFAULT_UPDATE_TIME))
{
}

LogViewer::~LogViewer(void)
{
gCoreContext->SaveDurSetting("LogViewerUpdateTime", m_updateTime);
Expand Down
8 changes: 1 addition & 7 deletions mythplugins/mytharchive/mytharchive/logviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <QTimer>

// myth
#include <libmyth/mythcontext.h>
#include <libmythui/mythscreentype.h>

static constexpr std::chrono::seconds DEFAULT_UPDATE_TIME { 5s };
Expand All @@ -22,12 +21,7 @@ class LogViewer : public MythScreenType

public:

explicit LogViewer(MythScreenStack *parent)
: MythScreenType(parent, "logviewer"),
m_autoUpdate(gCoreContext->GetBoolSetting("LogViewerAutoUpdate", true)),
m_updateTime(gCoreContext->GetDurSetting<std::chrono::seconds>(
"LogViewerUpdateTime", DEFAULT_UPDATE_TIME))
{};
explicit LogViewer(MythScreenStack *parent);
~LogViewer(void) override;

bool Create(void) override; // MythScreenType
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/mytharchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#include <QTimer>

// mythtv
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythcoreutil.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythplugin.h>
#include <libmythbase/mythpluginapi.h>
#include <libmythbase/mythsystemlegacy.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/mythburn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

// myth
#include <mythconfig.h>
#include <libmyth/mythcontext.h>
#include <libmythbase/exitcodes.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythmiscutil.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythbase/stringutil.h>
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mytharchive/mytharchive/recordingselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <QTimer>

// mythtv
#include <libmyth/mythcontext.h>
#include <libmythbase/mthread.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdb.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <QString>

#include <libmythbase/mythlogging.h>
#include <libmythbase/remotefile.h>

extern "C" {
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/selectdestination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#include <QKeyEvent>

// myth
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythcoreutil.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/stringutil.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythuibutton.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mytharchive/mytharchive/themeselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
#include <QCoreApplication>

// myth
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythuibutton.h>
#include <libmythui/mythuibuttonlist.h>
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/thumbfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@

// myth
#include <mythconfig.h>
#include <libmyth/mythcontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythmiscutil.h> // for MythFile::copy
#include <libmythbase/programinfo.h>
#include <libmythui/mythdialogbox.h>
Expand Down
7 changes: 4 additions & 3 deletions mythplugins/mytharchive/mytharchive/videoselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
#include <QTimer>

// mythtv
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/remotefile.h>
#include <libmythbase/stringutil.h>
#include <libmythmetadata/videoutils.h>
#include <libmythbase/storagegroup.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythuibutton.h>
Expand Down Expand Up @@ -451,7 +452,7 @@ std::vector<VideoInfo *> *VideoSelector::getVideoListFromDB(void)
if (info->filename.isEmpty())
{
// file must not be local or doesn't exist
info->filename = generate_file_url("Videos", host, filename);
info->filename = StorageGroup::generate_file_url("Videos", host, filename);
}
}

Expand Down
10 changes: 3 additions & 7 deletions mythplugins/mytharchive/mytharchivehelper/mytharchivehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <libmythbase/exitcodes.h>
#include <libmythbase/mythcommandlineparser.h>
#include <libmythbase/mythcoreutil.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdirs.h>
Expand Down Expand Up @@ -2390,12 +2391,10 @@ static int main_local(int argc, char **argv)
// Don't listen to console input
close(0);

gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init(false))
MythContext context {MYTH_BINARY_VERSION};
if (!context.Init(false))
{
LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
delete gContext;
gContext = nullptr;
return GENERIC_EXIT_NO_MYTHCONTEXT;
}

Expand Down Expand Up @@ -2556,9 +2555,6 @@ static int main_local(int argc, char **argv)
cmdline.PrintHelp();
}

delete gContext;
gContext = nullptr;

exit(res);
}

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythbrowser/mythbrowser/bookmarkeditor.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythdate.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythlogging.h>
#include <libmythui/mythmainwindow.h>

// mythbrowser
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/bookmarkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
#include <QString>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythuibuttonlist.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/browserdbutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#include <QSqlError>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdbcheck.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsorthelper.h>

// mythbrowser
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/libmythbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#include <QApplication>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythpluginapi.h>
#include <libmythbase/mythversion.h>
#include <libmythui/mythmainwindow.h>
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/mythbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <QEvent>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythlogging.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythuihelper.h>
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/mythflashplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <QEvent>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythlogging.h>
#include <libmythtv/playgroup.h>
#include <libmythui/mythmainwindow.h>
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/webpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <QIcon>

// MythTV
#include <libmythbase/mythlogging.h>
#include <libmythui/mythmainwindow.h>

// mythbrowser
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythgame/mythgame/gamedbcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
#include <QSqlError>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdbcheck.h>
#include <libmythbase/mythlogging.h>

// MythGame
#include "gamedbcheck.h"
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythgame/mythgame/gamedetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <QFile>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythuibutton.h>
#include <libmythui/mythuihelper.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythgame/mythgame/gamehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
#include <QRegularExpression>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythgame/mythgame/gamescan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <QUrl>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythevent.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/remoteutil.h>
Expand Down
1 change: 1 addition & 0 deletions mythplugins/mythgame/mythgame/gamesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// MythTV
#include <libmythbase/mythdb.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>

// MythGame
#include "gamesettings.h"
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythgame/mythgame/gameui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
#include <QTimer>

// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythmetadata/mythuimetadataresults.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythgenerictree.h>
Expand Down
3 changes: 2 additions & 1 deletion mythplugins/mythgame/mythgame/mythgame.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// MythTV
#include <libmyth/mythcontext.h>
#include <libmythbase/lcddevice.h>
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythdbcon.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythpluginapi.h>
#include <libmythbase/mythversion.h>
#include <libmythui/myththemedmenu.h>
Expand Down
3 changes: 0 additions & 3 deletions mythplugins/mythgame/mythgame/rom_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
// Qt
#include <QFile>

// MythTV
#include <libmyth/mythcontext.h>

// MythGame
#include "rom_metadata.h"

Expand Down
Loading
Loading