Skip to content

Commit

Permalink
convert googletakeout format to dynamic.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Aug 29, 2023
1 parent f891584 commit 918712f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 3 additions & 6 deletions googletakeout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,13 @@ GoogleTakeoutFormat::title_case(QString& title)
}

void
GoogleTakeoutFormat::rd_init(const QString& fname) {
GoogleTakeoutFormat::read()
{
if (global_opts.debug_level >= 4) {
Debug(4) << "rd_init(" << fname << ")";
}
inputStream = GoogleTakeoutInputStream(fname);
}
GoogleTakeoutInputStream inputStream(fname);

void
GoogleTakeoutFormat::read()
{
int items = 0;
int points = 0;
int place_visits = 0;
Expand Down
6 changes: 4 additions & 2 deletions googletakeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class GoogleTakeoutInputStream
class GoogleTakeoutFormat : public Format
{
public:
using Format::Format;

/* Member functions */
QVector<arglist_t>* get_args() override
{
Expand All @@ -81,7 +83,8 @@ class GoogleTakeoutFormat : public Format
return { ff_cap_read, ff_cap_read, ff_cap_none };
}

void rd_init(const QString& fname) override;
void rd_init(const QString& fname) override
{}
void read() override;

private:
Expand Down Expand Up @@ -119,7 +122,6 @@ class GoogleTakeoutFormat : public Format

/* Data Members */

GoogleTakeoutInputStream inputStream;
QVector<arglist_t> googletakeout_args;
};

Expand Down
4 changes: 2 additions & 2 deletions vecs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ struct Vecs::Impl {
GeoJsonFormat geojson_fmt;
GlobalsatSportFormat globalsat_sport_fmt;
QstarzBL1000Format qstarz_bl_1000_fmt;
GoogleTakeoutFormat google_timeline_fmt;
#endif // MAXIMAL_ENABLED

const QVector<vecs_t> vec_list {
Expand Down Expand Up @@ -495,11 +494,12 @@ struct Vecs::Impl {
nullptr,
},
{
&google_timeline_fmt,
nullptr,
"googletakeout",
"Google Takeout Location History",
"json",
nullptr,
&fmtfactory<GoogleTakeoutFormat>
}
#endif // MAXIMAL_ENABLED
};
Expand Down

0 comments on commit 918712f

Please sign in to comment.