BeamNG_IRC

Untitled

Feb 4th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. #include <QDir>
  2. #include "editdiaryentry.h"
  3. #include "ui_editdiaryentry.h"
  4.  
  5. EditDiaryEntry::EditDiaryEntry(QWidget *parent) :
  6.     QWidget(parent),
  7.     ui(new Ui::EditDiaryEntry) {
  8.     ui->setupUi(this);
  9. }
  10.  
  11. EditDiaryEntry::~EditDiaryEntry(){
  12.     delete ui;
  13. }
  14. void EditDiaryEntry::AddItemToTable(QString Title, QString Date) {
  15.     ui->test->setText("test");
  16.     qDebug("test");
  17. }
  18.  
  19. void EditDiaryEntry::ParseFile() { // this function will retrieve local diary entries
  20.     /*
  21.      * How this will work:
  22.      * - list all .diary files in %userprofile%\diary
  23.      * - open them one at a time for parsing
  24.      * - call AddItemToTable for listing
  25.      */
  26.     char *szBuff;
  27.     QString user = szBuff = std::getenv("USERPROFILE"); // this will get the users %userprofile% location
  28.     QDir dir(user + "/diary"); // our final directory to look in
  29.     QStringList nameFilter("*.diary"); // our iflter for *.diary
  30.     QDir directory(dir);
  31.     QStringList DiaryFiles = directory.entryList(nameFilter);
  32.     AddItemToTable("Test", "Test");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment