.
This commit is contained in:
+8
-1
@@ -1414,6 +1414,10 @@ void cMainWindow::onActionExport()
|
||||
xmlWriterSerie.writeTextElement("seriesID", QString("%1").arg(lpSerie->seriesID()));
|
||||
xmlWriterSerie.writeTextElement("seriesOverview", lpSerie->overview());
|
||||
xmlWriterSerie.writeTextElement("seriesYear", QString("%1").arg(lpSerie->firstAired().year()));
|
||||
if(lpSerie->hasProgress() || lpSerie->hasDone())
|
||||
xmlWriterSerie.writeTextElement("seriesStarted", "true");
|
||||
else
|
||||
xmlWriterSerie.writeTextElement("seriesStarted", "false");
|
||||
|
||||
xmlWriterSerie.writeEndElement();
|
||||
}
|
||||
@@ -1421,7 +1425,6 @@ void cMainWindow::onActionExport()
|
||||
xmlWriterSerie.writeEndElement();
|
||||
fileSerie.close();
|
||||
|
||||
|
||||
QFile fileMovie("C:\\Temp\\export\\movies.xml");
|
||||
fileMovie.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriterMovie(&fileMovie);
|
||||
@@ -1440,6 +1443,10 @@ void cMainWindow::onActionExport()
|
||||
xmlWriterMovie.writeTextElement("movieID", QString("%1").arg(lpMovie->movieID()));
|
||||
xmlWriterMovie.writeTextElement("movieOverview", lpMovie->overview());
|
||||
xmlWriterMovie.writeTextElement("movieYear", QString("%1").arg(lpMovie->releaseDate().year()));
|
||||
if(lpMovie->state() == cMovie::StateDone || lpMovie->state() == cMovie::StateProgress)
|
||||
xmlWriterMovie.writeTextElement("movieStarted", "true");
|
||||
else
|
||||
xmlWriterMovie.writeTextElement("movieStarted", "false");
|
||||
|
||||
xmlWriterMovie.writeEndElement();
|
||||
}
|
||||
|
||||
+23
@@ -180,6 +180,29 @@ void cSeason::setLabel1(QLabel* lpLabel1)
|
||||
m_lpLabel1 = lpLabel1;
|
||||
}
|
||||
|
||||
|
||||
bool cSeason::hasProgress()
|
||||
{
|
||||
for(int x = 0;x < m_episodeList.count();x++)
|
||||
{
|
||||
cEpisode* lpEpisode = m_episodeList.at(x);
|
||||
if(lpEpisode->state() == cEpisode::StateProgress)
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cSeason::hasDone()
|
||||
{
|
||||
for(int x = 0;x < m_episodeList.count();x++)
|
||||
{
|
||||
cEpisode* lpEpisode = m_episodeList.at(x);
|
||||
if(lpEpisode->state() == cEpisode::StateDone)
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
void cSeason::setAllInit(QPushButton* lpAllInit)
|
||||
{
|
||||
m_lpAllInit = lpAllInit;
|
||||
|
||||
@@ -66,6 +66,9 @@ public:
|
||||
void updateState();
|
||||
void deleteResources();
|
||||
|
||||
bool hasProgress();
|
||||
bool hasDone();
|
||||
|
||||
void allInit();
|
||||
void allProgress();
|
||||
void allDone();
|
||||
|
||||
+28
@@ -479,6 +479,34 @@ qint16 cSerie::maxEpisode()
|
||||
return(iMax);
|
||||
}
|
||||
|
||||
bool cSerie::hasProgress()
|
||||
{
|
||||
for(int x = 0;x < m_seasonList.count();x++)
|
||||
{
|
||||
if(!x)
|
||||
continue;
|
||||
|
||||
cSeason* lpSeason = m_seasonList.at(x);
|
||||
if(lpSeason->hasProgress())
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cSerie::hasDone()
|
||||
{
|
||||
for(int x = 0;x < m_seasonList.count();x++)
|
||||
{
|
||||
if(!x)
|
||||
continue;
|
||||
|
||||
cSeason* lpSeason = m_seasonList.at(x);
|
||||
if(lpSeason->hasDone())
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cSerie::save(QSqlDatabase &db)
|
||||
{
|
||||
QSqlQuery query;
|
||||
|
||||
Reference in New Issue
Block a user