mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 09:08:20 -04:00
Remove botched .gitattributes changes
This reverts commits a658b0595e69a478f464132a382bb7fa3fd9722a and a2c0c65006f00e5924ce9636749ca47c570680cc.
This commit is contained in:
parent
a658b0595e
commit
8d5e68e4a7
79
.gitattributes
vendored
79
.gitattributes
vendored
@ -6,82 +6,3 @@
|
||||
/dependencies/create-dmg export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
|
||||
# Auto detect text files and perform LF normalization
|
||||
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
|
||||
* text=auto
|
||||
|
||||
#
|
||||
# The above will handle all files NOT found below
|
||||
#
|
||||
|
||||
# Documents
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
*.md text
|
||||
*.adoc text
|
||||
*.textile text
|
||||
*.mustache text
|
||||
*.csv text
|
||||
*.tab text
|
||||
*.tsv text
|
||||
*.sql text
|
||||
|
||||
# Graphics
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.gif binary
|
||||
*.tif binary
|
||||
*.tiff binary
|
||||
*.ico binary
|
||||
# SVG treated as an asset (binary) by default. If you want to treat it as text,
|
||||
# comment-out the following line and uncomment the line after.
|
||||
*.svg binary
|
||||
#*.svg text
|
||||
*.eps binary
|
||||
|
||||
# Sources
|
||||
*.c text
|
||||
*.cc text
|
||||
*.cxx text
|
||||
*.cpp text
|
||||
*.c++ text
|
||||
*.hpp text
|
||||
*.h text
|
||||
*.h++ text
|
||||
*.hh text
|
||||
|
||||
# Compiled Object files
|
||||
*.slo binary
|
||||
*.lo binary
|
||||
*.o binary
|
||||
*.obj binary
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch binary
|
||||
*.pch binary
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so binary
|
||||
*.dylib binary
|
||||
*.dll binary
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai binary
|
||||
*.la binary
|
||||
*.a binary
|
||||
*.lib binary
|
||||
|
||||
# Executables
|
||||
*.exe binary
|
||||
*.out binary
|
||||
*.app binary
|
||||
|
@ -1,82 +1,82 @@
|
||||
#include "check_new_version.h"
|
||||
|
||||
#include <QUrl>
|
||||
#include <QtGlobal>
|
||||
#include <QStringList>
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#define PREVIOUS_VERSION_TESTING "6.0.0"
|
||||
|
||||
HttpVersionChecker::HttpVersionChecker()
|
||||
:HttpWorker("https://bitbucket.org/luisangelsm/yacreader/wiki/Home")
|
||||
{
|
||||
connect(this,SIGNAL(dataReady(const QByteArray &)),this,SLOT(checkNewVersion(const QByteArray &)));
|
||||
}
|
||||
|
||||
void HttpVersionChecker::checkNewVersion(const QByteArray & data)
|
||||
{
|
||||
checkNewVersion(QString(data));
|
||||
}
|
||||
|
||||
bool HttpVersionChecker::checkNewVersion(QString sourceContent)
|
||||
{
|
||||
#ifdef Q_OS_WIN32
|
||||
QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}win32");
|
||||
#endif
|
||||
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}X11");
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}Mac");
|
||||
#endif
|
||||
|
||||
int index = 0;
|
||||
bool newVersion = false;
|
||||
bool sameVersion = true;
|
||||
//bool currentVersionIsNewer = false;
|
||||
#ifdef QT_DEBUG
|
||||
QString version(PREVIOUS_VERSION_TESTING);
|
||||
#else
|
||||
QString version(VERSION);
|
||||
#endif
|
||||
QStringList sl = version.split(".");
|
||||
if((index = rx.indexIn(sourceContent))!=-1)
|
||||
{
|
||||
int length = qMin(sl.size(),(rx.cap(4)!="")?4:3);
|
||||
for(int i=0;i<length;i++)
|
||||
{
|
||||
if(rx.cap(i+1).toInt()<sl.at(i).toInt())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(rx.cap(i+1).toInt()>sl.at(i).toInt()){
|
||||
newVersion=true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
sameVersion = sameVersion && rx.cap(i+1).toInt()==sl.at(i).toInt();
|
||||
}
|
||||
if(!newVersion && sameVersion)
|
||||
{
|
||||
if((sl.size()==3)&&(rx.cap(4)!=""))
|
||||
newVersion = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(newVersion == true)
|
||||
{
|
||||
emit newVersionDetected();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#include "check_new_version.h"
|
||||
|
||||
#include <QUrl>
|
||||
#include <QtGlobal>
|
||||
#include <QStringList>
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#define PREVIOUS_VERSION_TESTING "6.0.0"
|
||||
|
||||
HttpVersionChecker::HttpVersionChecker()
|
||||
:HttpWorker("https://bitbucket.org/luisangelsm/yacreader/wiki/Home")
|
||||
{
|
||||
connect(this,SIGNAL(dataReady(const QByteArray &)),this,SLOT(checkNewVersion(const QByteArray &)));
|
||||
}
|
||||
|
||||
void HttpVersionChecker::checkNewVersion(const QByteArray & data)
|
||||
{
|
||||
checkNewVersion(QString(data));
|
||||
}
|
||||
|
||||
bool HttpVersionChecker::checkNewVersion(QString sourceContent)
|
||||
{
|
||||
#ifdef Q_OS_WIN32
|
||||
QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}win32");
|
||||
#endif
|
||||
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}X11");
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}Mac");
|
||||
#endif
|
||||
|
||||
int index = 0;
|
||||
bool newVersion = false;
|
||||
bool sameVersion = true;
|
||||
//bool currentVersionIsNewer = false;
|
||||
#ifdef QT_DEBUG
|
||||
QString version(PREVIOUS_VERSION_TESTING);
|
||||
#else
|
||||
QString version(VERSION);
|
||||
#endif
|
||||
QStringList sl = version.split(".");
|
||||
if((index = rx.indexIn(sourceContent))!=-1)
|
||||
{
|
||||
int length = qMin(sl.size(),(rx.cap(4)!="")?4:3);
|
||||
for(int i=0;i<length;i++)
|
||||
{
|
||||
if(rx.cap(i+1).toInt()<sl.at(i).toInt())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(rx.cap(i+1).toInt()>sl.at(i).toInt()){
|
||||
newVersion=true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
sameVersion = sameVersion && rx.cap(i+1).toInt()==sl.at(i).toInt();
|
||||
}
|
||||
if(!newVersion && sameVersion)
|
||||
{
|
||||
if((sl.size()==3)&&(rx.cap(4)!=""))
|
||||
newVersion = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(newVersion == true)
|
||||
{
|
||||
emit newVersionDetected();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user