Skip to content

Commit

Permalink
Add directories for emails and announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Ahlers committed Apr 4, 2015
1 parent 5bd305a commit 41772fe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ void Parser::parseFiles(QNetworkReply *reply, QMap<QNetworkReply*, Structureelem
QString title = file["title"].toString();
QString from = "Anküdigung im L²P";
int time = file["modifiedTimestamp"].toInt();
QString dirname = "Announcement";
urlParts.append(dirname);

Structureelement *dir = Utils::getDirectoryItem(currentCourse, urlParts);

Expand Down Expand Up @@ -276,6 +278,9 @@ void Parser::parseFiles(QNetworkReply *reply, QMap<QNetworkReply*, Structureelem
QString title = file["subject"].toString();
QString from = file["from"].toString();
int time = file["modifiedTimestamp"].toInt();
QString dirname = "E-Mails";
urlParts.append(dirname);


Structureelement *dir = Utils::getDirectoryItem(currentCourse, urlParts);

Expand Down
2 changes: 1 addition & 1 deletion structureelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ bool Structureelement::operator< (const QStandardItem& other) const
{
return false;
}
else if ((typeEX == messageItem))
else if (typeEX == messageItem)
{
return (data(dateRole) < other.data(dateRole));
}
Expand Down
20 changes: 18 additions & 2 deletions utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,31 @@ Structureelement *Utils::getDirectoryItem(Structureelement *courseItem, QStringL
item = "Übungsdokumente";
}
else if (item.contains("EmailAttachments")) {
item = "E-Mail-Anhänge";
item = "E-Mails";
}
else if (item.contains("MediaLibrary")) {
item = "Medienbibliothek";
}
else if (item.contains("AnnouncementDocuments")) {
item = "Ankündigungs-Anhänge";
item = "Ankündigungen";
}
else if (item.contains("Announcement"))
{
item = "Ankündigungen";
}
}

// Bei anderen Sprachen werden Anhänge zu den Nachrichten gepackt.
if(QLocale::system().language() != QLocale::German)
{
if (item.contains("AnnouncementDocuments")) {
item = "Announcement";
}
else if (item.contains("EmailAttachments")) {
item = "E-Mails";
}
}

bool correctChildFound = false;
for(int row=0; row < currentItem->rowCount(); ++row)
{
Expand Down

0 comments on commit 41772fe

Please sign in to comment.