Bug 110420 - create many new file with CTRL+N
Summary: create many new file with CTRL+N
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-08 22:17 UTC by Yan Morin
Modified: 2006-03-03 16:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to create many empty file (566 bytes, patch)
2005-08-08 22:18 UTC, Yan Morin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yan Morin 2005-08-08 22:17:41 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

A way to create many tab (empty file) with CTRL+N like in Kate
Comment 1 Yan Morin 2005-08-08 22:18:29 UTC
Created attachment 12150 [details]
Patch to create many empty file
Comment 2 Yan Morin 2005-08-08 23:24:37 UTC
Other suggestions: (when opening file inside a project)q
Index: quanta_init.cpp
===================================================================
--- quanta_init.cpp     (révision 443949)
+++ quanta_init.cpp     (copie de travail)
@@ -658,7 +659,7 @@
   Document *w = ViewManager::ref()->activeDocument();
   if (w) //w==0 might happen on quick close on startup
   {
-    m_quanta->setCaption(w->url().prettyURL() );
+    m_quanta->setTitle(w->url().prettyURL() );
 //    m_quanta->slotUpdateStatus(w);//FIXME:
   }
 }


and when creating a new document:
Index: viewmanager.cpp
===================================================================
--- viewmanager.cpp     (révision 443949)
+++ viewmanager.cpp     (copie de travail)
@@ -107,7 +107,7 @@
 void ViewManager::createNewDocument()
 {
   int i = 1;
-  while (isOpened(KURL("file:"+i18n("Untitled%1").arg(i)))) i++;
+  while (isOpened(KURL("file://"+i18n("Untitled%1").arg(i)))) i++;
   QString fname = i18n("Untitled%1").arg(i);
   QuantaView *view = createView(fname);


This is only one line issue, it's more for the 'idea' that the real patch
Comment 3 András Manţia 2005-08-09 10:05:31 UTC
On Tuesday 09 August 2005 00:24, Yan Morin wrote:
> 23:24 ------- Other suggestions: (when opening file inside a
> project)q
> Index: quanta_init.cpp
> ===================================================================
> --- quanta_init.cpp     (révision 443949)
> +++ quanta_init.cpp     (copie de travail)
>  @ -658,7 +659,7  @
>    Document *w = ViewManager::ref()->activeDocument();
>    if (w) //w==0 might happen on quick close on startup
>    {
> -    m_quanta->setCaption(w->url().prettyURL() );
> +    m_quanta->setTitle(w->url().prettyURL() );
>  //    m_quanta->slotUpdateStatus(w);//FIXME:
>    }
>  }


I don't understand the reasoning of this patch.

>    int i = 1;
> -  while (isOpened(KURL("file:"+i18n("Untitled%1").arg(i)))) i++;
> +  while (isOpened(KURL("file://"+i18n("Untitled%1").arg(i)))) i++;


This will break a lot of things. "file:UntitledN" is a special (invalid) 
URL used to note not-yet-saved files.

Andras
Comment 4 Yan Morin 2005-08-09 12:01:49 UTC
Yes I thought that the // would corrected the file increment, but both didn't work I don't know why..
Comment 5 András Manţia 2005-08-09 15:14:25 UTC
BTW, why does this make sense? Certainly I hate when Kate restores 5 
Untitled documents on startup. ;-)
Comment 6 András Manţia 2006-03-03 16:32:29 UTC
As I said, I don't really like this behavior.