Skip to content

Instantly share code, notes, and snippets.

View lfranchi's full-sized avatar

Leo Franchi lfranchi

View GitHub Profile
@lfranchi
lfranchi / qca-2.0.3-clang-fix
Created September 26, 2012 17:33
QCA 2.0.3 patch for clang compatibility
diff --git a/src/botantools/botan/botan/secmem.h b/src/botantools/botan/botan/secmem.h
index f421220..5ba2b8f 100644
--- a/src/botantools/botan/botan/secmem.h
+++ b/src/botantools/botan/botan/secmem.h
@@ -214,7 +214,7 @@ class SecureVector : public MemoryRegion<T>
SecureVector(u32bit n = 0) { MemoryRegion<T>::init(true, n); }
SecureVector(const T in[], u32bit n)
- { MemoryRegion<T>::init(true); set(in, n); }
+ { MemoryRegion<T>::init(true); this->set(in, n); }
@lfranchi
lfranchi / qt-4.8-qmacnativewidget-fixes
Created August 16, 2012 22:56
Fixes for keyboard input and focus when using QMacNativeWidget on qt 4.8
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 9783ecb..b383a3f 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -821,6 +821,11 @@ static int qCocoaViewCount = 0;
return [NSActionCell class];
}
+-(BOOL)needsPanelToBecomeKey
+{
@lfranchi
lfranchi / liblastfm-4.8-POST-fix
Created June 14, 2012 19:29
liblastfm qt 4.8 post fix
diff --git a/src/ws.cpp b/src/ws.cpp
index 196af40..3ebcbbd 100644
--- a/src/ws.cpp
+++ b/src/ws.cpp
@@ -171,8 +171,9 @@ lastfm::ws::post( QMap<QString, QString> params, bool sk )
+ QUrl::toPercentEncoding( i.value() )
+ '&';
}
-
- return nam()->post( QNetworkRequest(baseUrl()), query );
@lfranchi
lfranchi / phonon-vlc-set-plugin-path.patch
Created June 12, 2012 10:36
phonon-vlc set vlc plugin path
diff --git a/src/utils/libvlc.cpp b/src/utils/libvlc.cpp
index 44f07db..3df5190 100644
--- a/src/utils/libvlc.cpp
+++ b/src/utils/libvlc.cpp
@@ -64,6 +64,8 @@ bool LibVLC::init()
#endif
args << QFile::encodeName(pluginsPath);
+ qputenv("VLC_PLUGIN_PATH", QDir::toNativeSeparators(QFileInfo(self->vlcPath()).dir().path()).toUtf8());
+
@lfranchi
lfranchi / vlc-buildsystem-fix-xcode-4.3
Created June 12, 2012 07:18
VLC buildsystem fix for XCode 4.3
diff --git a/contrib/bootstrap b/contrib/bootstrap
index df3dd85..a0a7244 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -143,15 +143,19 @@ add_make_enabled()
check_macosx_sdk()
{
- [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5
- SDK="/Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
@lfranchi
lfranchi / qt-static-diff.patch
Created May 21, 2012 22:57
Qt 4.8 static build os x
diff --git a/configure b/configure
index 48b76d3..81c3e6a 100755
--- a/configure
+++ b/configure
@@ -6258,6 +6258,11 @@ if [ "$PLATFORM_MAC" = "yes" ]; then
CFG_COREWLAN=no
fi
fi
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
+ QT_CONFIG="$QT_CONFIG coreservices"
@lfranchi
lfranchi / phononvlc-check-bundle-patch
Created March 4, 2012 21:47
[Phonon-VLC]: Check for bundle libs before system
diff --git a/src/utils/libvlc.cpp b/src/utils/libvlc.cpp
index 248760b..5ef18a3 100644
--- a/src/utils/libvlc.cpp
+++ b/src/utils/libvlc.cpp
@@ -177,19 +177,20 @@ QStringList LibVLC::findAllLibVlcPaths()
QStringList paths;
#ifdef Q_OS_UNIX
- paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH"))
- .split(QLatin1Char(':'), QString::SkipEmptyParts);
@lfranchi
lfranchi / gist:1966604
Created March 3, 2012 15:26
qt-osx-disable-webkit-qtkit
diff --git a/src/3rdparty/webkit/Source/WebCore/features.pri b/src/3rdparty/webkit/Source/WebCore/features.pri
index f04d0b4..661854e 100644
--- a/src/3rdparty/webkit/Source/WebCore/features.pri
+++ b/src/3rdparty/webkit/Source/WebCore/features.pri
@@ -163,10 +163,10 @@ symbian|maemo5|maemo6 {
DEFINES += ENABLE_VIDEO=0
mac:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
- DEFINES -= ENABLE_VIDEO=0
- DEFINES += ENABLE_VIDEO=1
import math
def countDigits(n):
asStr = str(n)
sum = 0
for char in asStr:
sum += int(char)
return sum
cur = 0
import xml.etree.ElementTree, numpy
f = open("2.html", 'r')
#f = open("1.html", 'r')
html = f.readlines()
root = xml.etree.ElementTree.fromstringlist(html)
print list(root)
nums = []