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 #671

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b02f6a2
MythBackend.php: fix comment
ulmus-scott Nov 20, 2022
bb534a8
libs: remove unnecessary includes of "libmyth/mythcontext.h"
ulmus-scott Nov 20, 2022
b2aa617
programs: remove unnecessary includes of "libmyth/mythcontext.h"
ulmus-scott Nov 20, 2022
e54b6ec
plugins: remove unnecessary includes of "libmyth/mythcontext.h"
ulmus-scott Nov 20, 2022
631e5af
MythContextSlotHandler: merge into MythContextPrivate
ulmus-scott Nov 19, 2022
455e47d
MythContextPrivate: PIMPL idiom style
ulmus-scott Nov 20, 2022
a78ac30
MythContext::Impl: remove member m_parent
ulmus-scott Nov 20, 2022
9beaa2f
MythContext::Impl: create LanguagePrompt()
ulmus-scott Nov 20, 2022
84a31f8
MythContext: C++ does not require a void parameter
ulmus-scott Nov 20, 2022
1f17bf8
MythContext::Impl::ResetDatabase(): convert to a static function
ulmus-scott Nov 22, 2022
0be6388
MythContext::Impl::LoadDatabaseSettings(): split into three function …
ulmus-scott Nov 22, 2022
0dcf6c1
MythContext::Impl::SaveDatabaseParams(): directly access the MythDB s…
ulmus-scott Nov 22, 2022
241d6a5
libmyth/mythcontext.h: remove unnecessary includes
ulmus-scott Nov 17, 2024
3d75bcf
create libmythbase/mythappname.h for MYTH_APPNAME_*
ulmus-scott Nov 17, 2024
927e3a2
libmythmetadata/imagemetadata: remove Qt 5.4.1 specific code
ulmus-scott Nov 17, 2024
ccd0f8f
remove unnecessary includes of "libmythbase/mythcorecontext.h"
ulmus-scott Nov 18, 2024
32bf802
libmythbase/mythcorecontext.h: remove unnecessary include of "mythlog…
ulmus-scott Nov 18, 2024
d65f7d6
DatabaseParams: remove unused parameter m_forceSave
ulmus-scott Nov 18, 2024
fba03fe
remove DatabaseParams::LoadDefaults()
ulmus-scott Nov 18, 2024
f2507e2
libmyth/mythcontext.cpp: create class DatabaseParamsCache
ulmus-scott Nov 18, 2024
79beef7
MythContext::Impl::SilenceDBerrors(): fix braces
ulmus-scott Nov 18, 2024
36e8e2c
move constants to XmlConfiguration
ulmus-scott Nov 18, 2024
f580fb3
move constant to SSDP
ulmus-scott Nov 18, 2024
217ce16
merge DatabaseParamsCache into MythDB
ulmus-scott Nov 18, 2024
07b7694
mythfrontend/exitprompt.cpp: remove backend connection popup hack
ulmus-scott Nov 20, 2024
9f11340
libmyth/mythcontext: remove gContext
ulmus-scott Nov 22, 2024
a212a84
SignalHandler: move calls into MythContext
ulmus-scott Nov 22, 2024
a57d74a
merge CleanupGuard into MythContext
ulmus-scott Nov 22, 2024
5940b60
fixup 'libmythbase/mythcorecontext.h: remove unnecessary include of "…
ulmus-scott Dec 2, 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 @@ -54,6 +54,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 @@ -2389,12 +2390,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 @@ -2555,9 +2554,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