GithubHelp home page GithubHelp logo

ma7t3 / schedulemaster Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 8.62 MB

ScheduleMaster is a free and open source rich-feature timetable and tour planning software.

Home Page: https://github.com/users/ma7t3/projects/5

License: GNU General Public License v3.0

C++ 98.90% QMake 1.10%

schedulemaster's Introduction

ScheduleMaster

schedulemaster's People

Contributors

ma7t3 avatar

Stargazers

 avatar

Watchers

 avatar

schedulemaster's Issues

Better and more secure way to create new ProjectDataItem instances

There are still issues with all kind of projectData with it's QObject::parenting, so we can't ensure that all of that data is deleted correctly when the file is closed but also the application crashes sometimes when stuff is deleted, which is still necessary.
This is a huge problem, especially when it comes to larger projects and bigger amount of data.
We use the QObject's parenting and object hierarchy system to control when an object should be deleted.
But the problem is: new Objects are created all over the entire application and it's not possible to ensure that all objects always get the correct parent.
To fix this issue and improve the code I suggest:

  • move all "generatings" of objects to a central place in the code:
  • every projectDataItem that can or should own other projectDataItems gets a special "new"-Functions which generates a new child, sets is as a child, adds it and returns it. For example (in Line class):
Route *newRoute(const Route &newRoute) {
   // create new Route object by copying the given one
   Route *r = new Route(newRoute);
   // set parent
   r->setParent(this);
   // add to "myself"
   addRoute(r);
   // return for further modification if necessary
   return r;
}

From everywhere when a new object is needed it can use this new function. With that we can ensure that every object gets the right parent and (!) lives in the right thread (which is a problem with the PlgOmsiImporter for example).

[BUG] It's not possible to undo renaming a LineDirection

Describe the bug
If you do undo, after you changed the name of a LineDirection, the name doesn't change back to how it was before.

Additional context
It doesn't work, because of LineDirection::copy(). The method doesn't create a copy of all changed LineDirections, so the result is, that it modifies the original one, and than there is no "old source" more to get the previous data back.
Solution: Always copy all directions by value, not reference in LineDirection::copy()

cleanup user interface (esp. menubar)

  • complete menubar ("Schedule", "Tours", etc.)
  • Remove not implemented features (e.g. "Cleanup & Troubleshooting")
  • Make "last used files" in the menubar actually work
  • equip everything with icons

copy() function does not work correctly (at least in ProjectSettings)

Code:

    void undo() override {
        for (int i = 0; i < s->dayTypeCount(); ++i) {
            qDebug() << " - " << s->dayTypeAt(i)->name();
        }

        *s = oldS;
        for (int i = 0; i < oldS.dayTypeCount(); ++i) {
            qDebug() << " - " << oldS.dayTypeAt(i)->name();
        }

        for (int i = 0; i < s->dayTypeCount(); ++i) {
            qDebug() << " - " << s->dayTypeAt(i)->name();
        }
    }

Output:

 -  "Montag-Freitag"
 -  "Samstag"
 -  "Sonn-/Feiertag"
 -  "Schultage"
 -  "Ferientage"
 -  "Montag-Freitag"
 -  "Samstag"
 -  "Sonn-/Feiertag"
 -  "Schultage"
 -  "Ferientage"
 -  "Ferientage"
 -  "Ferientage"
 -  "Ferientage"
 -  "Ferientage"
 -  "Ferientage"

copy()-function

    ProjectDataItem::copy(other);
    setNames(other.displayName(), other.shortName());
    setIcon(other.icon());

    QList<DayType *>  newDayTypes;
    for(int i = 0; i < other.dayTypeCount(); i++) {
        DayType *dt = other.dayTypeAt(i);
        if(hasDaytype(dt->id())) {
            DayType *current = dayType(dt->id());
            *current = *dt;
            newDayTypes << current;
        } else {
            newDayTypes << dt;
        }
    }
    setDayTypes(newDayTypes);

compress data to reduce file size

Idea for saving files:

  1. Generate the JSON-String as normal
  2. Take it as a QByteArray
  3. Use qCompress() to compress it
  4. save the compressed ByteArray to file

Reversed for reading file

Some trips are missing in PDF line export

Ursache könnte sein: Es fehlen in der pdf immer die Touren, die ein äquivalent am Samstag hätten.
Exportiere ich z.B. auch nur Samstag, so kommt immer noch die selbe Seite mit Mo-Fr wie oben

PDF line schedules

  • day types
  • page numbers
  • footnotes (requires #19)
  • improve UI widget
  • extend possibilities to configure the schedule

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.