Merge branch 'master' into ubuntu

This commit is contained in:
Petr Bena 2014-05-25 17:29:45 +02:00
commit adc19767b8
2 changed files with 8 additions and 11 deletions

View File

@ -24,7 +24,7 @@ string Configuration::URL = "";
string Configuration::Expiry = "60";
bool Configuration::Private = false;
string Configuration::Author = "";
string Configuration::Version = "1.0.2";
string Configuration::Version = "1.0.3";
string Configuration::Title = "";
string Configuration::Home = "";
string Configuration::DefaultURL = "";
@ -60,6 +60,11 @@ void Configuration::Init()
}
f.close();
}
if (Configuration::Author.length() < 1)
{
// we don't have any author here! let's get it from passwd
Configuration::Author = pw->pw_name;
}
}
void Configuration::Store()

View File

@ -10,7 +10,6 @@
#include <iostream>
#include <string>
#include <unistd.h>
#include <curl/curl.h>
#include "configuration.hpp"
#include "terminalparser.hpp"
@ -36,17 +35,10 @@ int main(int argc, char *argv[])
}
delete t;
if (!Stikkit::Configuration::Author.length())
{
char buffer[200];
if (getlogin_r(buffer, 200))
{
Stikkit::Configuration::Author = buffer;
} else
{
// we need to provide some author name otherwise stikked will not display anything or some random characters there
Stikkit::Configuration::Author = "Unknown";
}
}
if (!Stikkit::Configuration::URL.length())
{
if (Stikkit::Configuration::DefaultURL.length() > 0)